<!doctype html>
<html lang="zh-CN">

  <head>
    <meta charset="utf-8" />
    <title>意休Doit | GTD清单处理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description"
      content="意休Doit是一个完成事项的小工具，包括清单处理，内容记录（链接/检查卡/随记/问题/记忆项/特殊任务/任务进程/搜索记录），数据统筹处理（标签和项目管理），签到和日历签等功能。" />
    <link rel="shortcut icon" href="./static/baobao.png" type="image/png" />
    <link rel="bookmark" href="./static/baobao.png" />
    <link rel="stylesheet" type="text/css" href="./css/review.css" />
    <!-- <link rel="stylesheet" type="text/css" href="./css/mobile.css" media="(max-width: 780px)" /> -->
    <!-- <script type="text/javascript">
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
      window.matchMedia('(max-width: 780px)').matches) { // 当前设备为移动设备或最大宽度小于780px的时候，继续加载样式 mobile.css
      const olink = document.createElement('link');
      olink.rel = 'stylesheet';
      olink.type = 'text/css';
      olink.href = './css/mobile.css';
      document.head.append(olink);
    }
  </script> -->
  </head>

  <body class="theme-light">
    <!-- 菜单 -->
    <div class="menu on noselect">
      <h1>
        <img src="./static/logo.png" class="logo" alt="意休Doit的logo" title="意休Doit，跳转到线上网页"
          onclick="toLink('https://kathy_candy.gitee.io/doit')" />
        <span class="nowlocation" title="回到主页">主页</span>
        <span class="menu-left">
          <span class="simplebtn housebtn" data-name="切简版" title="简版页-数据处理与保存(快捷键Alt+A)"></span>
          <span class="simplebtn materialsbtn" title="资料页-网站收藏"></span>
          <span class="simplebtn runworkbtn" title="启动页-记录任务进程"></span>
          <span class="simplebtn checkbtn" title="检查页-数据显示和统筹(快捷键Alt+C)"></span>
          <span class="simplebtn helpbtn" title="帮助页-特殊任务情况和使用帮助"></span>
          <span class="starbtn handstand-heart" title="今天心情不好，记录一下"></span>
          <span class="timeStatus" title="任务中/休息中"></span>
        </span>
      </h1>
      <span class="circlebtn listbtn" title="折叠/展开全部清单">叠</span>
      <span class="circlebtn writebtn" data-open="0" title="打开/关闭书写框(快捷键Alt+W)"></span>
      <span class="circlebtn notebtn" data-open="0" title="显示/隐藏总结面板(关闭Alt+Z)"></span>
      <span class="settingbtn" data-val="1" title="打开/关闭设置面板(关闭Alt+Z)"></span>
    
      <div class="getSummary">
        <div class="scrollbar_orange"></div>
        <div class="progress-outer" title="（点击查看特殊任务）">
          <mark class="taskwarn" title="近期存在定期任务，点击跳转到日历签查看">！</mark>
          <span class="countdown"></span>
          <span class="progress">日期 星期 已完成/总任务数 (百分比)</span>
        </div>
      </div>
    </div>
    <span class="btn moremenubtn" data-status="0"></span>
    <div class="towritebtn" title="打开/关闭书写框(Alt+W)"><span class="writebtn"></span></div>
    <div class="btn totopbtn" title="单击回到顶部,双击折叠或展开各清单" data-tab="叠"></div>
    <!-- 侧边菜单 -->
    <div class="asidemenu noselect">
      <div class="toshowmenu" data-status="0" data-aside="0" title="打开/关闭菜单"> &gt;&gt; </div>
      <span class="collectjumpbtn jumpbtn" data-menu="0" title="收集箱(Box 快捷键Alt+B，Alt+Z)"></span>
      <span class="tagjumpbtn jumpbtn" data-menu="1" title="标签管理(Tag 快捷键Alt+T，Alt+Z)"></span>
      <span class="questionjumpbtn jumpbtn" data-menu="3" title="问题记录(Question 快捷键Alt+Q，Alt+Z)"></span>
      <span class="itemjumpbtn jumpbtn" data-menu="4" title="项目管理(Item 快捷键Alt+I，Alt+Z)"></span>
      <span class="calendarjumpbtn jumpbtn" data-menu="5" data-month="4" title="日历/记录签(Record 快捷键Alt+R，Alt+Z)"></span>
      <span class="savebtn jumpbtn" title="保存用户数据"></span>
    </div>
    <!-- 提示弹框 -->
    <div class="tellyoubox">
      <span class="tellBtnClose"></span>
      <p class="title">标题</p>
      <p class="input"><input type="text" placeholder="输入框" /></p>
      <div class="tellBtnLine"><span class="btn">取消</span><span class="btn">确定</span></div>
    </div>
    <!-- 书写框 -->
    <div class="write">
      <div class="back" onclick="writeLayer()" title="点击关闭输入框">
        <div class="btn closetipbtn">×</div>
      </div>
      <div class="btn turnwritebtn" title="把内容转到主页输入框进行处理" onclick="switchWrite('0')"> &lt;&lt; </div>
      <div class="btn needhelpbtn" title="内容自动切换到特殊任务模式 【若更换切换内容需点击“清空”才生效】">切</div>
      <div class="btn turnwritebtn" title="把内容转到简版页输入框进行批量处理" onclick="switchWrite('2')">批</div>
      <div class="btn needhelpbtn" title="关于该书写框的一些隐秘功能介绍">秘</div>
      <textarea class="writebox" placeholder="（带*的按钮支持用*分隔多项进行批量添加）"></textarea>
      <div class="writeboxTips">随记随感-解决问题时遇到的难点/关键点/技巧等方面的想法（用关键词写）</div>
      <div class="btns noselect">
        <span class="circlebtn" title="优先清空：紧急重要标志和日期；切换的各种状态也会清空(快捷键Alt+0)" accesskey="0">清空</span>
        <span class="circlebtn addtodotask" title="加入执行清单，支持*号多项添加(快捷键Alt+D)">快速添加D*</span>
        <span class="circlebtn itemchange" title="写入小本本，不支持多项添加(快捷键Alt+Enter)">加入随记</span>
        <span class="circlebtn edit itemchange" title="仅是单个值修改，标红效果是临时的">标红修改</span>
        <span class="circlebtn" title="不支持多项添加(快捷键Alt+1)" accesskey="1">+ 参考资料</span>
        <span class="circlebtn" title="支持*号多项添加(快捷键Alt+2)" accesskey="2">+ 检查卡*</span>
        <span class="circlebtn" title="用[]括住的部分后期支持隐藏切换，不支持多项添加(快捷键Alt+3)" accesskey="3">+ 记忆模块</span>
        <span class="circlebtn datebtn" title="内容末尾加当日日期，它将用于日期过期判断和日期排序">加日期</span>
        <span class="circlebtn" title="确保添加链接的位置同时占据头尾或只在中间，建议每项事件只含一个链接">加链接</span>
        <span class="circlebtn setrefreshtask">确定任务内容*</span>
        <span class="circlebtn dorefreshtask">开启任务</span>
        <span class="circlebtn inSearchbtn" title="含链接搜索时只会取文本部分搜索(快捷键Alt+T)">内搜T</span>
        <span class="circlebtn webSearchbtn" title="含链接搜索时只会取文本部分搜索(快捷键Alt+S)">外搜S</span>
        <span class="circlebtn toWebSearchbtn" title="去设置搜索范围">设置</span>
        <span class="circlebtn" title="自动转换，让每行为一项，原有*分隔的项不变">自动处理</span>
        <span class="circlebtn" title="标记为紧急项">@急</span>
        <span class="circlebtn" title="标记为重要项">@重</span>
        <span class="circlebtn tocollectbox" title="加入收集箱">收集箱*</span>
      </div>
      <div class="writingplace"></div>
    </div>
    
    <!-- 众页面 -->
    <div id="pages">

      <!-- 主清单层 -->
      <div class="main">
        <div class="main-wrapper">
          <div class="btn toRightFixbtn" data-aside="0">&lt;</div>
          <div class="btn toRightBtn bigger">&gt;</div>

          <div class="content mainpart">
            <div class="topInput">
              <div class="searchControl noselect">
                <span data-id="2" title="在标签管理里搜索">站内搜T</span>
                <span data-id="1" title="快速接口-前置: a翻译/b近邻词/w1或w2解决办法/g1或g2搜歌/g3古诗相关">站外搜S<b class="toWebSearchBtn"
                    title="进入设置面板选择在哪里搜索、是否开启搜索记录">设</b></span>
              </div>
              <input class="simpleWriteBox" type="text" placeholder="Enter输入，Alt+T内搜，Alt+S外搜" />
              <div class="turnwritebtn" title="把内容转换到书写框进行处理" onclick="switchWrite('1')"> &lt;&lt; </div>
              <div class="addfunbtns noselect">
                <button title="在末尾添加紧急标志 @急" type="button">急</button>
                <button title="在末尾添加重要标志 @重" type="button">重</button>
                <button title="在末尾添加今天日期" type="button">今</button>
                <button title="清空输入框，优先清空标志" type="button">清</button>
              </div>
              <div class="buttonline noselect" data-index="0">
                <u class="toknewbtn" title="每日每周该怎么用该应用？如何对事项进行分类？">?</u>
                <label data-index="0"><input type="radio" name="list" value="执行" checked="checked" />执行</label>
                <label data-index="1"><input type="radio" name="list" value="日历" />日历</label>
                <label data-index="2"><input type="radio" name="list" value="等待" />等待</label>
                <label data-index="3"><input type="radio" name="list" value="项目" />项目</label>
                <label data-index="4"><input type="radio" name="list" value="可能" />可能</label>
                <label data-index="5" title="添加到小本本（不支持*多项添加）"><input type="radio" name="list" value="随记" />随记</label>
                <label data-index="6" title="添加到收集箱（支持*多项添加）"><input type="radio" name="list" value="收集" />收集</label>
                <!-- <span class="openwritebtn">···</span> -->
              </div>
            </div>
            <div class="listContent-wrapper">

              <!-- 执行清单 -->
              <header class="header" data-id="1">
                <h2 class="showing" title="执行清单的事项该是可执行且可一步搞定的，完成项以打勾为准" style="margin-top: 20px;">执行清单-专一 (<span
                    class="thingsNum">0</span>)</h2>
              </header>
              <section class="part">
                <div class="controlers">
                  <label><input type="checkbox" value="" />反选</label>
                  <span class="circlebtn solvedBtn" title="完成项确认：确认当前勾选项已完成">处理</span>
                  <span class="circlebtn sortBtn" onclick="sortFirst(0)" title="优先级排序：指定数字越小的排在最前面">优先序</span>
                  <span class="circlebtn addBtn" title="添加执行清单项">&#65291;</span>
                  <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑、删除与优先级选择"><i
                      class="writebtn"></i></span>
                </div>
                <div class="list">
                  <p class="tips">专心做一件事（可执行且可一步搞定）</p>
                  <ul class="detail tmpDolist"></ul>
                </div>
              </section>

              <!-- 日历 -->
              <header class="header" data-id="1">
                <h2 class="showing" title="注意：日期写在最后，以2020-01-01格式书写">日历清单-闹钟 (<span class="thingsNum">0</span>) </h2>
              </header>
              <section class="part">
                <div class="controlers">
                  <label><input type="checkbox" value="" />反选</label>
                  <span class="circlebtn solvedBtn" title="完成项确认：确认当前勾选项已完成">处理</span>
                  <span class="circlebtn sortBtn" onclick="sortFirst(1)" title="优先级排序：指定数字越小的排在最前面">优先序</span>
                  <span class="circlebtn" onclick="sortIt()" title="日期排序：从过去到未来">日期升序</span>
                  <span class="circlebtn addBtn" title="添加日历清单项">&#65291;</span>
                  <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑、删除与优先级选择"><i
                      class="writebtn"></i></span>
                </div>
                <div class="list">
                  <p class="tips">有期限的事，日期写最后（格式 2020-01-01）</p>
                  <ul class="detail tmpDaylist"></ul>

                </div>
              </section>

              <!-- 等待清单 -->
              <header class="header" data-id="1">
                <h2 class="showing" title="不该我做的事，留意下一步是什么？主动拿结果，并且确保事情顺利被完成">等待清单-确否 (<span class="thingsNum">0</span>)
                </h2>
              </header>
              <section class="part">
                <div class="controlers">
                  <label><input type="checkbox" value="" />反选</label>
                  <span class="circlebtn solvedBtn" title="完成项确认：确认当前勾选项已完成">处理</span>
                  <span class="circlebtn sortBtn" onclick="sortFirst(2)" title="优先级排序：指定数字越小的排在最前面">优先序</span>
                  <span class="circlebtn addBtn" title="添加等待清单项">&#65291;</span>
                  <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑与删除"><i
                      class="writebtn"></i></span>
                </div>
                <div class="list">
                  <p class="tips">不该我做的事，标明具体事项和时限，主动拿结果</p>
                  <ul class="detail tmpWaitlist">
                  </ul>
                </div>
              </section>

              <!-- 项目清单 -->
              <header class="header" data-id="1">
                <h2 title="空格@编号，编号仅支持小写字母|数字|下划线|短横线">项目清单-拆否</h2>
              </header>
              <section class="part">
                <div class="controlers">
                  <span class="circlebtn" onclick="toLink('https://www.yuque.com/')">语雀 </span>
                  <span class="circlebtn mindmapbtn" data-status="0">思维导图</span>
                  <span class="circlebtn" onclick="toLink('https://mubu.com/app')">幕布 </span> <span
                    class="circlebtn toItemBtn">项目管理</span>
                  <span class="circlebtn addBtn" title="添加项目清单项">&#65291;</span>
                  <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑与删除"><i
                      class="writebtn"></i></span>
                </div>
                <div class="list">
                  <p class="tips" style="margin-left: -30px;">不可一步达成的分而治之（@编号写在最后）</p>
                  <ul class="detail tmpProject"></ul>
                </div>
              </section>

              <!-- 可能清单 -->
              <header class="header" data-id="1">
                <h2>可能清单-变否</h2>
              </header>
              <section class="part" style="margin-bottom: 30px;">
                <div class="controlers">
                  <span class="circlebtn" onclick="toLink('https://www.wolai.com/')">我来 </span> <span
                    class="circlebtn addBtn" title="添加可能清单项">&#65291;</span>
                  <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑与删除"><i
                      class="writebtn"></i></span>
                </div>
                <div class="list">
                  <p class="tips" style="margin-left: -30px;">想做但还没规划的事（why when how 阐述原因 预期效果 难度 影响 时机 可能性）</p>
                  <ul class="detail tmpMaylist"></ul>
                </div>
              </section>
            </div>
          </div>

          <div class="content simplepart">
            <div class="originFile noselect">
              <p class="p-line" style="margin-top: 20px;">
                <span class="simplebtn">清空文件</span>
                <input type="file" id="file_input" accept="text/plain, application/json" title="选择备份txt文件 或 同步json文件" />
                <br />
                <span class="simplebtn diff" title="拉取本地的json文件">加载.json</span>
                <span class="simplebtn" title="两种方式：备份文件导入 或 显示区数据导入，多项间的分隔应使用提示的符号">导入备份.txt (两种方式)</span>
              </p>

              <p class="p-line right" style="margin-top: 16px;">
                <span class="simplebtn diff" title="json文件同步到本地">保存.json</span>
                <span class="simplebtn" title="下载备份文件txt-主清单数据，可导入">另存备份.txt</span>
                <span class="simplebtn" title="下载处理文件md-包括参考资料，完成项和分析项等">另存处理.md</span>
              </p>
              <p class="p-line right">
                <span class="simplebtn" title="三种文件的区别说明">简单说明</span>
                <span class="simplebtn" title="在下面框可见">复制备份数据</span>
                <span class="simplebtn" title="在下面框可见">复制处理数据</span>
              </p>

              <div class="openInoutBtn" title="更多文本处理...">显</div>
            </div>
            <div class="wrapper">
              <div class="inoutWrapper">
                <div class="inoutControl noselect">
                  把<input class="findtext" type="text" placeholder="查找内容"
                    title="如果确定处理时选中了文本，那么将对选中部分进行查找和替换" />替换为<input type="text" placeholder="替换内容"
                    title="特别转换：@ZZ转大写 @zz转小写 @Zz首字母大写" />
                  <span data-index="0">替换</span>
                  <span data-index="1" title="清空输入区">清空</span>
                  <span data-index="2">md链接转html</span>
                </div>
                <div class="btn inoutHelpbtn">注</div>
                <div class="btn inoutHelpbtn" title="查找内容凸显">凸</div>
                <div class="btn inoutHelpbtn" title="清空下面显示框">清</div>
                <div class="btn inoutHelpbtn" title="把内容转换到书写框进行处理" onclick="switchWrite('11')">&lt;&lt; </div>
                <textarea class="writeBoxForCopy" placeholder="数据显示区(markdown格式) 或 备份数据导入区(需严格按照指定格式)"></textarea>
              </div>
              <div class="dataWrapper">
                <div class="finishbtn toMemorypart" title="跳转到记忆模块">看</div>
                <h4 style="margin-bottom: 10px;"><span class="progressSim" title="日期 星期 已完成任务数/总任务数 (算得的百分比)">0000-00-00
                    星期 已完成/全部 </span><span class="todayDakaTxt" title="当日签到项，点击查看签到记录">未签到</span></h4>
                <ul class="detailSimple" title="（遗忘曲线：[5分钟 30分钟 12小时] 1天 2天 4天 7天 15天）"></ul>
                <p class="tips">▶ 今日事项：（执行|日历|等待事项）<span class="finishbtn toDeletedata"
                    title="清空执行|日历|等待清单和回收箱">清</span>
                </p>
                <ul class="detailSimple"></ul>
                <ul class="detailSimple"></ul>
                <ul class="detailSimple"></ul>
                <p class="tips">▶ 完成事项：<span class="finishbtn toDeletedata" title="清空后，统筹数据里的完成数将重新计算">清</span><span
                    class="finishbtn tofinishpart" title="跳转到完成模块">看</span></p>
                <ul class="detailSimple"></ul>
              </div>
            </div>

          </div>
          <!-- 侧边栏 -->
          <aside class="aside">
            <div class="btn toRightBtn smaller" title="隐藏右侧栏">&gt;</div>
            <div class="btn toRightBtn fixedbtn" title="右侧栏完全显示出来">◆</div>
            <header class="header">
              <h2><span class="headname">刷新任务</span><span class="openSet" data-now="on" onclick="ableToEdit(this,-1);"
                  title="关闭/开启功能：对每一项进行操作"><i class="writebtn"></i></span></h2>
              <span class="btn circlebtn clearall" title="清空当前清单内容">清空</span>
            </header>
            <div class="controlers">
              <label>
                <input type="radio" data-index="0" checked="true" name="card" value="刷新任务" />刷新任务
              </label>
              <label>
                <input class="referinput" type="radio" data-index="1" name="card" value="参考资料" />参考资料
              </label>
              <label>
                <input type="radio" data-index="2" name="card" value="回收箱" />回收箱
              </label>
            </div>
            <div class="aside-content">

              <div class="list">
                <p class="tips">修改：书写框-切按钮/设置面板/帮助页-特殊任务</p>
                <ul class="detail tmpRefreshA"></ul>
              </div>
              <div class="list hidden">
                <p class="tips">提示：能找到的不存，有价值或稀罕的存</p>
                <ul class="detail linkReference"></ul>
                <ul class="detail tmpReference"></ul>
              </div>
              <div class="list hidden">
                <p class="tips">提示：删除的事项(事件变动了 | 没必要做的事)</p>
                <ul class="detail tmpRecycle"></ul>
              </div>
            </div>
          </aside>
          <!-- <div class="bodybg"></div> -->
        </div>
      </div>

      <!-- 总结层 -->
      <section class="upfloor">
        <div class="upfloor_content">
          <header>
            <div class="controlers">
              <label>
                <input type="checkbox" checked="true" value="check" />检查卡-核
              </label>
              <label>
                <input type="checkbox" checked="true" value="finish" />完成卡-验
              </label>
              <label>
                <input type="checkbox" checked="true" value="summary" />小本本-思
              </label>
            </div>
          </header>
          <div class="analyzeCon" data-num="3">
            <div class="list">
              <h4><span title="checklist">检查卡</span><span class="finishbtn toreferpart" title="详细分析完成清单数据">参</span>
                <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑与删除"><i
                    class="writebtn"></i></span>
              </h4>
              <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
              <ul class="detail checkList"></ul>
            </div>
            <div class="list">
              <h4><span title="finishlist">完成卡</span><span class="finishbtn tofinishpart" title="详细分析完成清单数据">看</span>
              </h4>
              <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
              <ul class="detail finishList"></ul>
            </div>
            <div class="list">
              <h4><span title="记录随记的地方summarylist">小本本</span>
                <span class="finishbtn toCopydata" title="进入标签管理，进一步处理随记">复</span>
                <span class="openSet" data-now="on" onclick="ableToEdit(this);" title="关闭/开启功能：对每一项进行文本编辑与删除"><i
                    class="writebtn"></i></span>
              </h4>
              <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
              <ul class="detail summaryList"></ul>
            </div>
          </div>
        </div>

      </section>

      <!-- 资源层 -->
      <div class="resource onepart">
        <section class="header-con">
          <div class="word_title title">
            <span class="btn addCollectUrlBtn" title="开启/关闭自定义链接的输入框">+</span>
          </div>
          <section class="addUrl noselect">
            <input type="text" class="urlName" placeholder="输入名称(仅支持中文 字母 数字-_)" />
            <input type="text" class="urlLink" placeholder="输入链接" />
            <span class="tips">（提示区）</span>
            <span class="certainBtn">添加</span>
            <span class="urlCloseBtn">×</span>
          </section>
          <p>自定义：<span id="newAddUrl"></span></p>
          <p>联系类：
            <b onclick="toLink('https://wx.qq.com/')">微信</b>
            <b onclick="toLink('https://mail.sina.com.cn/')" title="新规定：90天内不登录就会冻结账号">新邮</b>
            <b onclick="toLink('https://mail.qq.com/')">Q邮</b>
            <b onclick="toLink('https://mail.163.com/')">易邮</b>
            <b onclick="toLink('https://pan.baidu.com/')">百度云盘</b>
            <b onclick="toLink('https://www.jianguoyun.com/#/')">坚果云</b>
            <b onclick="toLink('https://cli.im/')">草料二维码</b>
            <b onclick="toLink('https://www.wjx.cn/')">问卷星</b>
            <br />
          </p>
          <p>平台类：
            <b onclick="toLink('https://www.yuque.com/')">语雀</b>
            <b onclick="toLink('https://www.wolai.com/')">我来</b>
            <b onclick="toLink('https://mubu.com/app')">幕布</b>
            <b onclick="toLink('https://www.kdocs.cn/')">金山</b> |
            <!-- <b onclick="toLink('https://trello.com/')">Trello</b> -->
            <b class="personOne"
              onclick="toLink('https://space.bilibili.com/101977006/favlist?fid=835945706&ftype=create')">B站</b>
            <b onclick="toLink('https://github.com/doyouho/')">Github*</b>
            <b onclick="toLink('https://gitee.com/kathy_candy')" title="类似的有腾讯云的coding.net">Gitee*</b> |
            <b class="new" onclick="toLink('https://xiezuocat.com/')">写作猫</b>
            <b onclick="toLink('https://www.zybuluo.com/')">md</b>
            <b onclick="toLink('https://codepen.io/')" title="在线代码块编辑展示平台">codepen</b>
            <b onclick="toLink('https://jsbin.com/')" title="在线代码块编辑展示平台">jsbin</b>
            <b onclick="toLink('https://js.design/workspace')" title="原型设计">即时设计</b>
            <b onclick="toLink('https://www.365editor.com/')">365编辑器</b> |
            <b onclick="toLink('https://mp.weixin.qq.com/')">微信小程序/公众号</b>
            <b class="personOne" onclick="toLink('https://kathy_candy.gitee.io/blog/#/')">博客</b>
            <b class="personOne" onclick="toLink('https://kathy_candy.gitee.io/doyouho.io/')">意休</b>
            <b class="personOne" onclick="toLink('https://www.66rpg.com/friend/23755826')">橙光游戏</b>
          </p>
          <p>资源类★：
            <b onclick="toLink('https://www.bookmarkearth.com/')">书签地球</b>
            <b class="long" onclick="toLink('http://www.shufami.com/')">书法迷</b>
            <b class="new" onclick="toLink('https://www.ruiwen.com/')" title="各种文体类内容">瑞文网</b>
            <b class="new" onclick="toLink('https://www.yuwenmi.com/')" title="含成语及故事">语文迷</b>
            <b onclick="toLink('https://www.gushiwen.cn/')">古诗文</b>
            <b onclick="toLink('https://www.xungushici.com/')">寻古诗词</b>
            <!-- <b class="new long" onclick="toLink('http://www.pthxx.com/index.html')">普通话1</b> -->
            <b class="new long" onclick="toLink('http://www.pthxuexi.com/index.html')">普通话</b>
            <b class="new long" onclick="toLink('http://rkl.intowz.com/')">绕口令</b>
            <b class="long" onclick="toLink('http://www.e12345.com/')">英语</b>
            <b onclick="toLink('https://www.100font.com/')">免费字体</b> |
            <b onclick="toLink('https://www.w3school.com.cn/r.asp')">w3c手册</b>
            <b class="long" onclick="toLink('http://css.doyoe.com/')">css3手册</b>
            <b class="new long" onclick="toLink('http://bbs.laoleng.vip/reference/docs/javascript.html')">JS备忘单</b>
          </p>
          <p>综合导航：
            <b onclick="toLink('https://www.xue8nav.com/')" title="站内可搜索">学吧</b>
            <b onclick="toLink('https://www.a.cool/')">阿酷</b>
            <b class="new" onclick="toLink('https://box.misiai.com/index.html')" title="无道杂货铺">无道</b>
            <b class="long" onclick="toLink('http://www.pickfree.cn/')">pickfree</b>
            <b onclick="toLink('https://site.sciping.com/')">学术</b>
            <b onclick="toLink('https://hao.ziticq.com/')" title="偏设计">字体</b>
            <b onclick="toLink('https://hao.uisdc.com/')" title="偏设计，里面箭头下还有配色、图书、色彩导航">优设</b>
            <b class="long" onclick="toLink('http://hao.shejidaren.com/')">设计</b>
            <b onclick="toLink('https://www.seeseed.com/')" title="偏设计">seeseed</b>
            <b onclick="toLink('https://www.91sotu.com/')" title="偏设计，站内可搜索">搜图</b>
            <b onclick="toLink('https://www.pslkzs.com/nav.php')" title="设计，站内可搜索">灰大设计</b>
            <!-- <b onclick="toLink('https://hotppter.com/')" title="PPT导航，站内可搜索">hotppter(PPT)</b> -->
            <!-- <b onclick="toLink('https://www.hippter.com/')" title="PPT导航，站内可搜索">hippter(PPT)</b> -->
            <b onclick="toLink('https://www.qingnian8.com/')">青年帮</b> |
            <b class="long" onclick="toLink('http://guozhivip.com/')" title="偏生活">果汁(生活)</b>
            <b onclick="toLink('https://creativemass.cn/')" title="站内可搜索">创意</b>
            <b class="long" onclick="toLink('http://ilxdh.com/')" title="偏生活，站内可搜索">龙轩</b>
            <b onclick="toLink('https://search.chongbuluo.com/')" title="偏生活，以搜索为主">虫部落</b> |
            <b class="long" onclick="toLink('http://www.xiaolvji.com/')" title="偏生活，以人为本">效率集</b>
            <b onclick="toLink('https://go.itab.link/')" title="偏生活">itab</b>
            <b class="long" onclick="toLink('http://hao.199it.com/')" title="也可以查www.199it.com">大数据</b>
            <!-- <b class="long" onclick="toLink('http://www.haoyonghaowan.com/')"> 好用好玩 </b> -->
          </p>
          <p>程序员导航：
            <b onclick="toLink('https://www.jikedaohang.com/')">极客导航</b>
            <b onclick="toLink('https://cxy521.com/')">程序员导航</b>
            <b onclick="toLink('https://iiter.cn/')">艾特网</b>
            <b class="new long" onclick="toLink('http://nav.poetries.top/')">前端导航</b>
            <b class="runout" onclick="toLink('https://www.daqianduan.com/nav')">大前端导航</b>
            <!-- <b class="runout long" onclick="toLink('http://code.giffox.com/')">程序员导航</b> -->
            <!-- <b onclick="toLink('https://www.daohangwan.com/board/ax9b')">导航湾</b> -->
          </p>
          <p>搜索：
            <b
              onclick="toLink('https://www.yuque.com/docs/share/16ec761a-8e2f-4811-ac2a-24a1399ef10c?#ulKPq')">[搜索地图]</b>
            <b class="new" onclick="toLink('https://weather.cma.cn/')">气象局</b>
            <b onclick="toLink('https://index.baidu.com/')">百度指数</b>
            <b onclick="toLink('https://xueshu.baidu.com/')">百度学术</b>
            <b onclick="toLink('https://weixin.sogou.com/')">搜狗微信</b>
            <b onclick="toLink('https://36kr.com/')">36氪</b> |
            <b onclick="toLink('https://www.cnblogs.com/qianguyihao/p/10701923.html')">[资源地图]</b>
            <b onclick="toLink('https://segmentfault.com/channel/frontend')">{思否}</b>
            <b onclick="toLink('https://www.csdn.net/nav/web')">{CSDN}</b>
            <b onclick="toLink('https://www.cnblogs.com/cate/108703/')">{博客园}</b>
            <b class="personOne" onclick="toLink('https://www.zhihu.com/people/ni-bao-bao-8-35')">{知乎}</b>
            <b onclick="toLink('https://juejin.cn/')">掘金</b>
            <b onclick="toLink('https://stackoverflow.com/')">Stackoverflow</b>
            <b onclick="toLink('https://github.com/search/advanced')">Github高级搜索</b>


          </p>
          <p class="linktip">【2022-10-30更新 · 说明】<b class="new">本次更新新增</b> | <b class="long">仅http，数据传输不够安全</b> | <b
              class="runout">可能访问不了</b> | <b>符号：[文章类] {前端方向}</b></p>
        </section>

        <section class="share_con">
          <div class="kapian">
            <div class="share_box">
              <h3>工具类（效率帮助）</h3>
              <p>集合：
                <b onclick="toLink('https://c.runoob.com/')" title="c.runoob.com/">菜鸟</b>
                <b class="new" onclick="toLink('https://www.bmcx.com/')" title="便民查询网www.bmcx.com/">便民</b>
                <b onclick="toLink('https://www.toolnb.com/')" title="www.toolnb.com/">集1</b>
                <b onclick="toLink('https://tool.oschina.net/')" title="tool.oschina.net/">集2</b>
                <b onclick="toLink('https://tool.lu/')" title="tool.lu/">集3</b>
                <b class="long" onclick="toLink('http://www.toolfk.com/')" title="www.toolfk.com/">集4</b>
                <b onclick="toLink('https://tool.cc/123/')" title="tool.cc/123/">集5</b>
                <b onclick="toLink('https://www.67tool.com/')" title="www.67tool.com/">集6</b>
                <b onclick="toLink('https://tool.chinaz.com/')" title="tool.chinaz.com/">站长</b>
                <b class="long" onclick="toLink('http://tools.jb51.net/')" title="tools.jb51.net/">脚本</b>
                <b onclick="toLink('https://www.sojson.com/')" title="www.sojson.com/">json1</b>
                <b onclick="toLink('https://www.json.cn/')" title="www.json.cn/">json2</b>
                <!-- <b class="long" onclick="toLink('http://www.jsons.cn/')" title="www.jsons.cn/">json1</b> -->
              </p>
              <p>颜色：
                <b class="long" onclick="toLink('http://zhongguose.com/')" title="zhongguose.com 中国色">卡1</b>
                <b onclick="toLink('https://flatuicolors.com/')" title="flatuicolors.com 色卡">卡2</b>
                <b class="long" onclick="toLink('http://colormind.io/bootstrap/')" title="colormind.io 可看到网站效果">选色1</b>
                <b onclick="toLink('https://coolors.co/')" title="colors.co 按空格获取随机色">选色2</b>
                <b onclick="toLink('https://c.runoob.com/front-end/6327/')" title="菜鸟工具-取随机色">选色3</b>
                <b onclick="toLink('https://color.adobe.com/zh/create/color-wheel')" title="color.adobe.com">选色4</b>
                <b onclick="toLink('https://colorhunt.co/')" title="colorhunt.co">选色5</b>
              </p>
              <p>字体图标：
                <b onclick="toLink('https://icomoon.io/app/#/select')">icomoon</b>
                <b onclick="toLink('https://www.iconfont.cn/')">iconfont</b>
                <b onclick="toLink('https://fontawesome.dashgame.com/')">fontawesome</b>
              </p>
              <p>图/导图：
                <b class="long" onclick="toLink('http://imgdh.com/')">图床</b>
                <b onclick="toLink('https://gitmind.cn/app/template')" title="在线脑图">GitMind</b>
                <b onclick="toLink('https://www.processon.com/')" title="在线协作绘图">processon</b>
              </p>
              <p>★★
                <b onclick="toLink('https://wantwords.net/')" title="词穷时查词1">万词王</b>
                <b class="new" onclick="toLink('https://tool.mingdawoo.com/')" title="词穷时查词2">近邻词</b>

                <b onclick="toLink('https://unicode-table.com/cn/html-entities/')"
                  title="Unicode字符百科，通用的那些字符都怎么表示的">HTML实体</b>
                <b onclick="toLink('https://c.runoob.com/front-end/854')">正则1</b>
                <b class="new" onclick="toLink('https://c.runoob.com/front-end/7625/')">正则可视</b>
                <b onclick="toLink('https://tool.oschina.net/regex/')">正则2</b>
                <b class="new" onclick="toLink('https://regexper.com/')">正则可视</b>
                <b onclick="toLink('https://coolbackgrounds.io/')">调背景</b>
                <b onclick="toLink('https://neumorphism.io/')">调阴影</b>
                <b onclick="toLink('https://www.shapedivider.app/')">调弧面</b>
                <b onclick="toLink('https://9elements.github.io/fancy-border-radius/')">调圆角</b>
                <b onclick="toLink('https://animista.net/')">调动画</b>
                <b onclick="toLink('https://alteredqualia.com/')">3D</b>
                <b onclick="toLink('https://chokcoco.github.io/CSS-Inspiration')">CSS灵感1</b>
                <b onclick="toLink('https://csslayout.io/')">CSS灵感2</b>
                <b class="new" onclick="toLink('https://cssbattle.dev/')">CSS Battle</b>
                
                <b onclick="toLink('https://css-tricks.com/')">css-tricks</b>
                <b onclick="toLink('https://caniuse.com/')">caniuse兼容</b>
                <b onclick="toLink('https://www.bootcdn.cn/')" title="CDN加速">BootCDN</b>
              </p>
            </div>
            <div class="share_box">
              <h3>官方与社区类（系统学习）</h3>
              <p>视频类：
                <b onclick="toLink('https://www.bilibili.com/')">Bilibili</b>
                <b class="long" onclick="toLink('http://www.imooc.com/course/list?c=fe')">慕课网</b>
                <b class="long" onclick="toLink('http://yun.itheima.com/course')">黑马程序员</b>
                <b onclick="toLink('https://ke.jikexueyuan.com/zhiye/web/')">{极客学院}</b>
                <b onclick="toLink('https://www.html.cn/')">HTML中文网</b>
                <b onclick="toLink('https://ke.qq.com/')">腾讯课堂</b>
                <b onclick="toLink('https://study.163.com/courses-search?keyword=%E5%89%8D%E7%AB%AF')">{网易云课堂}</b>
              </p>
              <p>文档类：
                <b onclick="toLink('https://www.w3school.com.cn/')">w3school</b>
                <b onclick="toLink('https://www.w3cschool.cn/javascript_guide/')">{w3cschool}</b>
                <b onclick="toLink('https://www.runoob.com/')">菜鸟教程</b>
                <b class="long" onclick="toLink('http://www.fenby.com/')" title="初学者互动编程平台">fenby</b>
                <b onclick="toLink('https://developer.mozilla.org/zh-CN/')">MDN</b>
                <b onclick="toLink('https://www.liaoxuefeng.com/wiki/1022910821149312')">廖JS</b>
                <b onclick="toLink('https://wangdoc.com/javascript/index.html')">阮JS</b>
                <b onclick="toLink('https://es6.ruanyifeng.com/')">阮ES6</b>
                <b onclick="toLink('https://www.jb51.net/onlineread/JavaScript-Garden-CN/')">js秘密</b>
                <!-- <b class="long" onclick="toLink('http://c.biancheng.net/skill/js/')">JS整理1</b> -->
                <b onclick="toLink('https://www.yuque.com/smallwhy/yyvuqy')">JS整理2</b>
                <b onclick="toLink('https://www.cnblogs.com/TomXu/archive/2011/12/15/2288411.html')">深入js</b>
              </p>
              <p>语言框架：
                <b onclick="toLink('https://html.spec.whatwg.org/multipage/')">【HTML】</b>
                <b onclick="toLink('https://www.w3.org/TR/CSS/')">【CSS】</b>
                <b onclick="toLink('https://www.w3.org/')">W3组织</b>
                <b onclick="toLink('https://www.typescriptlang.org/')">TypeScript</b>
                <b onclick="toLink('https://jquery.com/')">jQuery</b>
                <b class="long" onclick="toLink('http://nodejs.cn/api/')">Nodejs</b>
                <b onclick="toLink('https://stylus-lang.com/')">Stylus</b>
                <b onclick="toLink('https://www.sass.hk/')">Sass</b>
                <!-- <b class="long" onclick="toLink('http://lesscss.cn/')">Less</b> -->
                <b onclick="toLink('https://www.gulpjs.com.cn/')">Gulp</b>
                <b onclick="toLink('https://www.webpackjs.com/')">Webpack</b>
                <b onclick="toLink('https://www.bootcss.com/')">BootStrap</b>
                <b onclick="toLink('https://ant.design/index-cn')">Antd</b>
                <b onclick="toLink('https://element.faas.ele.me/#/zh-CN')">Element UI</b>
                <b onclick="toLink('https://www.electronjs.org/')">Eletron</b>
                <b onclick="toLink('https://developers.weixin.qq.com/miniprogram/dev/framework/')">微信开放文档</b>
              </p>
              <p>项目类：
                <b
                  onclick="toLink('https://github.com/search?o=desc&q=%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0+in%3Adescription&s=&type=Repositories')">{Github}
                </b>
                <b onclick="toLink('https://gitee.com/explore')">Gitee优秀项目</b>
                <b onclick="toLink('https://www.libhunt.com/')">Libhunt查库</b>
              </p>
            </div>
            <div class="share_box">
              <h3>前端日常</h3>
              <p>路线：
                <b onclick="toLink('https://www.bilibili.com/video/BV18E411H7Rc')">峰华</b>
                <b onclick="toLink('https://zxuqian.cn/front-end-learning-path')">路1</b>
                <b onclick="toLink('https://www.bilibili.com/video/BV1ZZ4y1H7rU')">Luke</b>
                <b onclick="toLink('https://objtube.gitee.io/front-end-roadmap/#/')">路2</b>
                <b onclick="toLink('http://www.bitcountrys.com/')">路3-得等</b>
                <b onclick="toLink('https://developer.aliyun.com/article/28882')">目录</b>
              </p>
              <p>大牛：
                <b class="long" onclick="toLink('http://www.ruanyifeng.com/blog/')">阮一峰</b>
                <b onclick="toLink('https://www.liaoxuefeng.com/')">廖雪峰</b>
                <b onclick="toLink('https://www.zhangxinxu.com/')">张鑫旭</b>
                <b class="new" onclick="toLink('https://www.w3cplus.com/')">大漠老师-w3cplus</b>
                
              </p>
              <p>插件：
                <b onclick="toLink('https://www.jq22.com/')">插件jq</b>
                <b onclick="toLink('https://www.html.cn/texiao/')">特效轮子</b>
                <b onclick="toLink('https://ext.dcloud.net.cn/')">dcloud插件</b>
                <b onclick="toLink('https://freefrontend.com/')">freefrontend</b>
              </p>
              <p>刷题：
                <b onclick="toLink('https://huruji.github.io/FE-Interview/#/')">题集1</b>
                <b onclick="toLink('https://interview.poetries.top/')">题集2</b>
                <b onclick="toLink('https://github.com/yisainan/web-interview')">题集3</b>
                <b class="long" onclick="toLink('http://www.h-camel.com/history.html')">思考题</b>
                <b class="new" onclick="toLink('https://cssbattle.dev/')" title="用最少的css代码实现图案">CSS Battle</b>
                <b class="new" onclick="toLink('https://github.com/chokcoco/iCSS')">CSS技巧</b>
                
                <b onclick="toLink('https://leetcode.cn/')">力扣</b>
                <b onclick="toLink('https://www.nowcoder.com/')">牛客</b>
                <b onclick="toLink('https://www.jianshu.com/p/53f6bf6f8d50')">[剑指offer]</b>
              </p>
              <p title="新尝试css hat">css：
                <b onclick="toLink('https://www.bootcss.com/p/layoutit/')">可视化布局</b>
                <b onclick="toLink('https://cssgrid-generator.netlify.app/')">Grid生成</b>
                <b onclick="toLink('https://cssgr.id/')">同上</b>
                <b onclick="toLink('https://grid.layoutit.com/')">同上</b>
                <b onclick="toLink('https://loading.io/flexbox/')">Flexbox生成</b>
                <!-- <b onclick="toLink('https://www.awwwards.com/')">高级网站</b> -->
              </p>
            </div>
          </div>
          <div class="kapian">
            <div class="share_box">
              <h3>人生百态</h3>
              <p>学校教学：
                <b onclick="toLink('https://ykt.eduyun.cn/ykt/index.html')" title="小初高各种课程和专题教育与相关教育政策">国家中小学网络云平台</b>
                <b onclick="toLink('https://higher.smartedu.cn/')" title="小初高各种课程和专题教育与相关教育政策">国家高等教育智慧教育平台</b>
                <b class="new" onclick="toLink('https://le.ouchn.cn/home')" title="国家开放大学终身教育平台">终身教育平台</b>
                <b onclick="toLink('https://www.xuexi.cn/')" title="应有尽有，学习电视台-教育频道-健康运动等，学习慕课-各行各业等等">学习强国</b>
                <b onclick="toLink('https://www.icourse163.org/')">中国大学MOOC </b>
                <b class="new" onclick="toLink('https://ebook.hep.com.cn/ebooks/index.html#/')"
                  title="高等教育出版社-大学教材电子版">高教书苑</b>
                <b class="new" onclick="toLink('https://www.eduyun.cn/')">国家教育资源公共服务平台 </b>
              </p>
              <p>动手：
                <b onclick="toLink('https://dazi.kukuw.com/')">打字1</b>
                <b class="runout" onclick="toLink('https://www.typingclub.com/')">打字2</b>
                <b onclick="toLink('https://www.keybr.com/')">打字3</b>
                <b onclick="toLink('https://zty.pe/')">打字4</b>
                <b class="new" onclick="toLink('https://boolean.method.ac/')">练布尔运算</b>
                <b onclick="toLink('https://shape.method.ac/')">练曲线1</b>
                <b onclick="toLink('https://bezier.method.ac/')">练曲线2</b>
                <b onclick="toLink('https://color.method.ac/')" title="限时选颜色">练眼1</b>
                <b onclick="toLink('https://type.method.ac/')" title="找准字间距">练眼2</b>
                <b onclick="toLink('https://cantunsee.space/')" title="选择更恰当的设计">练眼3</b>
              </p>
              <p>思考：
                <b class="long" onclick="toLink('http://www.sudokufans.org.cn/')">数独</b>
                <b class="long" onclick="toLink('http://lxqnsys.com/hnt/')">汉诺塔</b>
                <b class="long" onclick="toLink('http://guozhivip.com/fun/els/')">俄罗斯方块</b>
                <b onclick="toLink('https://blocks.ovh/')">拼积木</b>
                <b onclick="toLink('https://flexboxfroggy.com/')">青蛙回家-Flex</b>
                <b class="long" onclick="toLink('http://www.flexboxdefense.com/')">塔防-Flex</b>
                <b onclick="toLink('https://cssgridgarden.com/#zh-tw')">种萝卜-Grid</b>
              </p>
              <p>特别：
                <b onclick="toLink('https://www.artbreeder.com/browse')" title="除了捏脸，参考里面头像画画也是可以的">捏脸</b>
                <b class="new" onclick="toLink('https://trace.moe/')" title="trace.moe">图搜动漫</b>
                <b class="new" onclick="toLink('https://www.similarsites.com/')" title="similarsites.com">搜同类网站</b>
                <b class="new" onclick="toLink('https://www.modevol.com/')"
                  title="基于“降低所有人学习成本”，把的学习方法融入视频的一次实践的网站">渐构</b>
              </p>
              <p>娱乐：
                <!-- <b onclick="toLink('')">[More音乐]</b> -->
                <b onclick="toLink('https://www.itingwa.com/')" title="纯音乐，需登录">听蛙</b>
                <b class="long" onclick="toLink('http://www.htqyy.com/')">轻音乐</b>
                <b class="long" onclick="toLink('http://guozhivip.com/qt/')">白噪音</b>
                <b onclick="toLink('https://www.tosound.com/')" title="音效网">淘声</b> |
                <!-- <b class="runout" onclick="toLink('https://www.90lrc.cn/')">歌词</b> -->
                <b onclick="toLink('https://www.zhaogepu.com/')">找歌谱</b>
                <b class="long" onclick="toLink('http://www.qupu123.com/')">曲谱网</b> |
                <b class="long" onclick="toLink('http://guozhivip.com/jzg/')">架子鼓</b>
                <b onclick="toLink('https://www.autopiano.cn/')" title="可作为纯音乐来听">自由钢琴/伴奏</b>
                <b class="personOne"
                  onclick="toLink('https://i.youku.com/u/UMzk2MDYyMTg0?spm=a2h0k.11417342.soresults.dnameX')">| 优酷</b>
              </p>
              <p>阅读：
                <b class="new" onclick="toLink('https://www.shuxiangjia.cn/')" title="书籍方面的聚合导航">【书享家】</b>
                <b onclick="toLink('https://weread.qq.com/')">微信读书</b>
                <b onclick="toLink('https://www.jiumodiary.com/')">鸠摩搜书</b>
                <b onclick="toLink('https://ebook2.lorefree.com/')">lorefree</b>
                <b class="new" onclick="toLink('https://www.pdfdrive.com/">pdfdrive</b>
                <b class="runout long" onclick="toLink('http://cn.epubee.com/books/')">epubee</b>
                <b class="new long" onclick="toLink('http://www.ixinqing.com/')" title="心理方面书籍">心晴</b>
                <b onclick="toLink('https://dudianji.com/')">读典籍</b>
                <b onclick="toLink('https://new.shuge.org/')" title="古籍典藏类资源">书格</b> |
                <b class="new long" onclick="toLink('https://ittushu.net/')" title="部分免费可以另找资源">IT图书网</b>
                <b onclick="toLink('https://www.bookstack.cn/')">书栈网</b>
                <b onclick="toLink('https://docschina.org/')">印记中文</b>
                <b onclick="toLink('https://www.codingdict.com/')">编程字典</b>
                <b class="long" onclick="toLink('http://shouce.jb51.net/')">脚本手册</b>
              </p>
              <p>绘画：
                <!-- <b onclick="toLink('')">[More绘画]</b> -->
                <b onclick="toLink('https://www.gracg.com/')">涂鸦王国</b>
                <b onclick="toLink('https://uiiiuiii.com/inspirations/illustrations')">插画</b>
                <b class="long" onclick="toLink('http://weavesilk.com/')">(粒子对称)</b>
                <b onclick="toLink('https://c.runoob.com/more/shapefly-diagram/#')">(简单画图)</b>
                <b onclick="toLink('https://c.runoob.com/more/svgeditor/')">(SVG画图)</b>
                <b onclick="toLink('https://ps.gaoding.com/#/')">稿定(PS)</b>
                <b onclick="toLink('https://www.photopea.com/')">photopea(PS)</b>
              </p>
              <p>见识：
                <b onclick="toLink('https://topbook.cc/')" title="[高效视频书]">Topbook</b>
                <b onclick="toLink('https://open.163.com/ted/')">讲座</b>
                <b class="new" onclick="toLink('https://www.douyin.com/video/7049671301602069796')" title="思维模型了解">圆中百知模型</b>
                
                <b onclick="toLink('https://space.bilibili.com/344849038?from=search&seid=13692100793524727015')"
                  title="YJango的学习观[重新思考]">学习观</b>
                <b
                  onclick="toLink('https://search.cctv.com/search.php?qtext=%E7%99%BE%E5%AE%B6%E8%AE%B2%E5%9D%9B')">百家讲坛</b>
                <b onclick="toLink('https://tv.cctv.com/lm/ryzr/index.shtml')">人与自然</b>
                <b onclick="toLink('https://tv.cctv.com/lm/dwsj/index.shtml')">动物世界</b> |
                <b onclick="toLink('https://gallerix.asia/')">Gallerix博物馆</b>
                <b class="long" onclick="toLink('http://g2.ltfc.net/home')">中华珍宝馆</b>
                <b
                  onclick="toLink('https://www.zhihu.com/question/369427467/answer/999221554?utm_source=wechat_session')">[更多]</b>
              </p>
              <p>工具文档：
                <b onclick="toLink('https://www.yuque.com/nibaobao-youho/check/hotlink')">[快捷键]</b>
                <b onclick="toLink('https://blog.csdn.net/csl125/article/details/82891571')">[命令行]</b> |
                <b onclick="toLink('https://u.tools/docs/developer/welcome.html#plugin-json')">uTools</b>
                <b onclick="toLink('https://yuanliao.info/')">猿料</b>,
                <b class="long" onclick="toLink('http://getquicker.net/')">Quicker</b>,
                <b onclick="toLink('https://ask.dcloud.net.cn/docs/')">Dcloud文档</b>
                <b onclick="toLink('https://blog.csdn.net/youhoa/article/details/103589504')">[HB热键]</b>,
                <b onclick="toLink('https://code.visualstudio.com/docs#vscode/')" title="网页版输入vscode.dev">VScode</b>
                <b
                  onclick="toLink('https://code.visualstudio.com/docs/getstarted/keybindings#_default-keyboard-shortcuts')">&热键</b>,
                <b onclick="toLink('https://git-scm.com/docs')">Git</b>
                <b onclick="toLink('https://www.yuque.com/nibaobao-youho/frontend/ybqq0c#nAgg')">[Git备忘录]</b>,
                <b onclick="toLink('https://nodejs.org/zh-cn/')">Node</b>
                <b onclick="toLink('https://docsify.js.org/')" title="安装命令为npm i docsify-cli -g">docsify</b>

                <b onclick="toLink('https://docs.emmet.io/')">Emmet</b>
                <b
                  onclick="toLink('https://publish.obsidian.md/help-zh/%E7%94%B1%E6%AD%A4%E5%BC%80%E5%A7%8B')">Obsidian</b>
                <b onclick="toLink('https://docs.snipaste.com/zh-cn/')" title="官网：https://zh.snipaste.com/">Snipaste</b>
                <b onclick="toLink('https://www.voidtools.com/zh-cn/')">Everything</b>

                <!-- <b class="runout" onclick="toLink('https://gitee.com/docmirror/dev-sidecar/releases')" title="正常访问Github且给Github加速的工具">dev-sidecar</b> -->
              </p>
            </div>
          </div>

        </section>
      </div>

      <!-- 启动层 -->
      <div class="start onepart">
        <div class="taskForWork">
          <section class="mianContent">
            <span class="btn daka odaka" title="每天打下卡，方向不走偏"><span></span><b>签</b></span>

            <form autocomplete="off">
              <div class="taskContent">
                <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
                <div class="text">学习得适量适度，由什么得什么，不断找最优。</div>
                <div class="text personOne noselect" style="margin-bottom:20px;" title="如果不够专注，可用音乐辅助创造场景环境">
                  <b class="link" onclick="toLink('http://guozhivip.com/qt/')">《白噪》 </b>
                  <b class="link" onclick="toLink('https://www.kugou.com/yy/special/single/1513086.html')">《悠闲》 </b>
                  <b class="link" onclick="toLink('https://www.kugou.com/yy/special/single/1514174.html')">《触动》 </b>
                  <b class="link" onclick="toLink('https://www.kugou.com/yy/special/single/1383070.html')">《犯傻》 </b>
                  <b class="link" onclick="toLink('https://www.kugou.com/yy/special/single/3352777.html')">《恋之歌》 </b>
                </div>
                <div class="busyouter noselect" title="离开的时间">
                  <div class="busytime">
                    <div class="busyItems"></div>
                  </div>
                </div>

                <div class="meetinghouse noselect">
                  <div class="houseback"></div>
                  <div class="meetcat" title="点击获取任务进行的时间" onclick="recordBusyTime()"><img src="./static/baobao.png"
                      alt="猫猫图标" /></div>
                  <div class="lefttime"></div>
                </div>
                <div class="flyline noselect">
                  <div class="stopTimerBtn" title="停止计时" onclick="stopRunning()">Stop</div>
                  <div class="endtime">?min</div>
                  <div class="flymove"></div>
                </div>
                <div class="timer">
                  <div class="btn startBtn" title="准备工作：水，零食，梳子，安静的环境，运动放松，调整呼吸">
                    <b class="timer-text">开始计时</b>
                    <i></i>
                    <img src="./static/baobao.png" alt="猫猫图标" />
                  </div>
                </div>
                <!-- <p>（Tab键可以快速跳到下一个输入框）</p> -->
                <div class="maincon-wrapper">
                  <div class="singleLine">
                    <div class="oneline maintaskLine">
                      <b>主要任务： </b><input class="taskAGoal oData" type="text" placeholder="含默认值:可自定义或恢复" />
                      <em class="moretip">一天总任务是什么呢</em>
                      <span class="updownbtn" title="可把当前值设为默认的主要任务，下次将在生成中自动加入">设</span>
                      <span class="updownbtn" title="重置默认">默</span><em class="goalTxt noselect"></em>
                    </div>
                    <div class="oneline"><b>优先解决：</b><input class="taskGoal oData" type="text"
                        placeholder="上下切换执行清单数据" /><em class="moretip">具体、现在就能做的</em>
                      <span class="updownbtn" title="执行清单的上一项">上</span>
                      <span class="updownbtn" title="执行清单的下一项">下</span>
                      <em class="hastText noselect"></em>
                    </div>
                  </div>
                  <div class="oneline signItemLine">
                    <b>标优先级：
                      <label title="紧张状态"><input type="radio" name="signType" value="重要紧急" />重要紧急</label>
                      <label title="游刃有余"><input type="radio" name="signType" value="重要不紧急" />重要不紧急</label>
                      <label title="小插曲啊"><input type="radio" name="signType" value="不重要却紧急" />不重要紧急</label>
                      <label title="轻松状态"><input type="radio" name="signType" value="不重要不紧急" />不重要不紧急</label></b>
                  </div>
                  <div class="taskType">
                    <b title="听课5%, 阅读10%, 视听20%, 演示30%, 讨论50%, 实践75%, 教授给他人90%">做事类型： </b>
                    <div class="taskTypeItems">
                      <label><input type="checkbox" name="thingsType" value="整理" /><span class="cbox"></span>整理</label>
                      <label><input type="checkbox" name="thingsType" value="社交" /><span class="cbox"></span>社交</label>
                      <label><input type="checkbox" name="thingsType" value="生活" /><span class="cbox"></span>生活</label>
                      <label><input type="checkbox" name="thingsType" value="尝试" /><span class="cbox"></span>尝试</label>
                      <label><input type="checkbox" name="thingsType" value="学习" /><span class="cbox"></span>学习</label>
                      <label><input type="checkbox" name="thingsType" value="项目" /><span class="cbox"></span>项目</label>
                      <label><input type="checkbox" name="thingsType" value="教学" /><span class="cbox"></span>教学</label>
                      <label><input type="checkbox" name="thingsType" value="反三" title="改进，举一反三" /><span
                          class="cbox"></span>反三</label>

                    </div>

                  </div>
                  <div class="taskSkill">
                    <b>可用方法： </b>
                    <div class="taskSkillItems">
                      <label><input type="checkbox" name="vaSkills" value="实践试错" /><span
                          class="cbox"></span>实践试错</label>
                      <label><input type="checkbox" name="vaSkills" value="提问搜索" /><span
                          class="cbox"></span>提问搜索</label>
                      <label><input type="checkbox" name="vaSkills" value="视频-模块化" /><span
                          class="cbox"></span>视频-模块化</label>
                      <label><input type="checkbox" name="vaSkills" value="实战模仿" /><span
                          class="cbox"></span>实战模仿</label>
                      <label><input type="checkbox" name="vaSkills" value="导图-联想分类" /><span
                          class="cbox"></span>导图-联想分类</label>
                      <label><input type="checkbox" name="vaSkills" value="讨论" /><span class="cbox"></span>讨论</label>
                      <label><input type="checkbox" name="vaSkills" value="故事" /><span class="cbox"></span>故事</label>
                    </div>

                  </div>

                  <div class="singleLine">


                    <div class="numpart" title="计算区">
                      <span class="formdelBtn" title="清空所有表单数据">清空表单</span>
                      <div class="oneline" style="margin-top: 8px;"><b>计划用时：</b><input class="taskPTime oData"
                          type="number" min="3" placeholder="单位分钟" />
                        <span class="updownbtn" title="8分钟" onclick="addTime('8')">8</span>
                        <span class="updownbtn" title="15分钟" onclick="addTime('15')">15</span>
                        <span class="updownbtn" title="25分钟" onclick="addTime('25')">25</span>
                        <span class="updownbtn" style="color: var(--themecolor);" title="30分钟(不选择时默认该值)"
                          onclick="addTime('30')">30</span>
                        <span class="updownbtn" title="45分钟" onclick="addTime('45')">45</span>
                        <span class="updownbtn" title="60分钟" onclick="addTime('60')">60</span>
                      </div>
                      <div class="oneline"><b>自估难度：</b><input class="taskLevel oData" type="number" max="5" min="1"
                          placeholder="难度1~5" />
                        <div class="fiveheart" style="display: inline-block;">
                          <span class="starbtn" title="简单"></span>
                          <span class="starbtn" title="一般"></span>
                          <span class="starbtn" title="有点难"></span>
                          <span class="starbtn" title="很难"></span>
                          <span class="starbtn" title="地狱级"></span>
                        </div>
                      </div>
                      <div class="oneline"><b>开始时间：</b><input class="taskSFTime oData" type="text"
                          placeholder="格式10:20" />
                        <em class="moretip">now or never</em>
                        <span class="updownbtn" title="获取此刻的时间" onclick="balloonStart()">get</span>
                        <span class="updownbtn worktoWebSearchBtn" onclick="webSearchFun('start')"
                          title="搜索上面优先解决的内容">搜</span>
                        <span class="updownbtn popuptopbtn" title="让内容钉在桌面-置顶">盯</span>
                      </div>
                      <div class="oneline"><b>实际用时：</b><input class="taskFTime oData" type="number" min="1"
                          placeholder="单位分钟" />
                        <em class="moretip"> Let it be</em>
                        <span class="updownbtn" title="距离开始时间多少分钟了？算一算" onclick="getWorkTime()">算</span>
                      </div>
                      <div class="oneline">
                        <b>完成程度：</b><input class="taskFStatus oData" type="text" disabled placeholder="'生成'时自动计算" />
                        <em class="moretip">计划用时/实际用时的值</em>
                        <span class="updownbtn" onclick="getWorkProccess()" title="注意：实际用时为0时无法计算">算</span>
                      </div>
                    </div>
                    <div class="oneline" style="margin-top: 8px;"><b>困难或障碍在哪里：</b><input class="taskDifficult oData"
                        type="text" placeholder="如果有难度,难在哪里？" /><em class="moretip">What
                        happened?</em><span class="updownbtn" onclick="toMainSquare(3, '启动页困难')"
                        title="面临的困难一句话写不完，在问题记录里写">写</span></div>
                    <div class="oneline"><b>接下来？</b><input class="taskContinue oData" type="text"
                        placeholder="打算怎么处理或避免？" /><em class="moretip">Accept it, 办法总比困难多</em></div>
                    <div class="oneline"><b>生成文本 (禁止：增删&lt;br /&gt; 和输入左尖括号&lt;)</b>
                      <span class="updownbtn jumptoProgress" title="进入检查页查看生成的内容">看</span><br />
                      <textarea class="allTaskData" placeholder="(实践过程生成区域，可修改内容并写入检查页[点击上面“看”跳转]来分析)"></textarea>
                    </div>
                    <div class="btnLine oneline noselect">
                      <div class="dataSTNoteBtn" title="生成带模板的内容，可修改内容">生成</div>
                      <div class="dataSTNoteBtn" title="写入后的内容可在检查页查看">写入</div>
                      <span class="ostartTip">(提示：内容先生成后写入)</span>
                    </div>
                  </div>
                </div>

              </div>
            </form>
          </section>
        </div>
      </div>

      <!-- 检查层 -->
      <div class="check onepart">
        <header class="check-header" title="双击缩小/恢复该区域位置">
          <div class="header-back"></div>
          <!-- <div class="checksmallerBtn"></div> -->
          <div class="btn toTeachNextBtn" onclick="getRandomTxt(this, 'new')">Next</div>
          <div class="btn toTeachBtn unactive" onclick="getRandomTxt(this, 'open')">展开</div>
          <div class="data-header">
            <div class="datamonth" title="【困难日子：紫色[客观原因]+蓝色[主观影响]】，【任务量：黑色[无任务数]+灰色[含任务数]】">
              <ul class="daysClip noselect"></ul>
              <p class="tip" title="打钩表示签到了，完成任务数达标时[10-可自定义]显示数字">蓝色紫色↔困难</p>
            </div>
            <div class="datatext">
              <div>打卡数：<span></span> （<span></span>）</div>
              <div>已完成的任务数：<span></span> （<span></span>）</div>
              <div title="困难天数/总天数">挫折频率：<span></span> （一般最近30天）</div>
            </div>
          </div>

          <!-- 随机展示文本 -->
          <div class="book-header">
            <div class="share_box">
              <h3>实践出真知 </h3>
              <p>实践前搞清学习原则：明确输入输出，多例子连结，分而治之，验证实现。</p>
              <p>视频学习&gt;文档学习，目的学习&gt;盲目扫资料，思维导图&gt;简单总结，做项目分而治之并解释。</p>
              <p>技巧性：利用好奇心，故事引导，求知若渴，虚心若愚，不受已有模型影响。</p>
              <p>找项目：in:name/readme/description+空+词；stars/forks/pushed/language+:+数/日-期/语言</p>
            </div>
            <div class="share_box">
              <h3>解决问题能力 定位</h3>
              <p>a.个人能力—&gt; 通用能力 + 专业能力</p>
              <p>专业能力 = 专业知识 + 解决问题 </p>
              <br />
              <p>b.解决问题/组织运用能力 = 指导下解决-独立解决-独立高质量解决-指导他人解决。</p>
              <p>能力认定在于问题大小和解决的程度。</p>
            </div>
            <div class="share_box">
              <h3>解决问题能力 考量</h3>
              <p>a.体现思路，骨干代码，功能实现</p>
              <p>b.这样解决是好，还是很好？(会不会存在什么问题？你已解决了多少？能想到多少问题？还能解决多少？有没有其他方案，为什么选择这个，什么情况下其他方案更优秀？)</p>
              <p>c.想出尽可能多的解决思路，选最优解</p>
            </div>
            <div class="share_box">
              <h3>解决问题能力 细节</h3>
              <p>a.算法结构 逻辑的展现</p>
              <p>b.经验 经验足不足</p>
              <p>c.英语 阅读</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 A（为什么学习）</h3>
              <p>费曼说过，如果你没有办法用简单的语言表述你所学的知识，你就没有真正学会。</p>
              <p>学习：从有限的例子中找到问题和答案的规律（知识）的过程，这也是把信息压缩成知识的过程。</p>
              <p>学习是为了用有限的知识解决新问题。学习正是用知识（找出规律）来压缩信息。</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 B（学习原则1）</h3>
              <p>学习的第一步：明确输入和输出，即问题和答案。（容易存在的误区：学习不等同记忆，知识不等同信息）</p>
              <p>学习的第二步：用例子构建知识。学习中分清例子和知识，构建自己的知识体系。华罗庚的把书读厚再读薄的过程。</p>
              <p>学习的第三步：验证知识的有效性。</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 C（学习误区）</h3>
              <p>学习误区——知识分运动类和思考类，而错误学习的原因有三：</p>
              <p>（1）错误的输入输出</p>
              <p>（2）错误学习方式:如用学运动类的方法学思考类的知识</p>
              <p>（3）不用例子学习/把知识当信息（记忆的时候特别需要例子来配合）</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 D （学习原则2）</h3>
              <p>我们可以同时应用多个运动类知识，但意识在某一刻只能专注于一个思考类问题。因此若无法从脑中搜索到能直接从输入到输出的知识，问题就无法解决，再加上掌握的知识有限，难度更大了，它需要分而治之。</p>
              <p>应对办法：（1）多学知识 （2）分而治之。（解决指数级数量的问题）</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 E （学习方法一）</h3>
              <p>思维导图：除了帮助记忆，还意在帮助你克服学习和应用中的误区。</p>
              <p>（1）列关键词——它是什么(压缩信息，找输入输出) </p>
              <p>（2）找到输入输出变量之间不变的函数关系(即规律)——它的目的(弄懂输入是怎么变成输出的)——优化关键词</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 F （学习方法一）</h3>
              <p>（3）拆分知识，这种能力属于二阶知识。拆分的思路可分为正向思维与逆向思维两种，拆分原则是知识之间尽可能彼此独立。</p>
              <p>（4）二阶知识：描述知识与知识的关系（一般知识描述信息与信息的关系）知识与知识的条件循环与并列组合的过程。</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 G （学习方法二）</h3>
              <p>费曼技巧= 学习（思维导图）+ 解释（满足原则4：用新例子验证知识）。</p>
              <p>——费曼技巧是以【目的】为导向的学习方法，核心在【验证】。(即温故而知新，可以为师矣)</p>
              <p>思维导图满足3个原则：明确知识的输入输出，用例子重塑大脑链接，理清关系与拆分知识。</p>
              <p>——思维导图是以【过程】为主导的学习方法，核心在【拆分】。</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 H （学习观运用）</h3>
              <p>学习英语——这个运动类知识，听 说 读 写，是学习单词，不是记忆单词。</p>
              <p>文理科学习的区别在于变体的数量，变体少的时候可以选择记忆，变体多的时候必须学习（掌握规律）。</p>
              <p>由于计算机的出现，我们应该学习一些变体多、可替代性低的知识。</p>
            </div>
            <div class="share_box">
              <h3 title="摘自YJango的学习观，可B站搜视频">学习观---知识小记 I （学习认知）</h3>
              <p>（1）感知真实——依靠模型。</p>
              <p>人看到的世界和接收的信息并不是全部的，但确实能让我们生存下去的。感知模型无法改变，认知模型依靠科学，观念模型太多。</p>
              <p>（2）建模欲望——好奇心（好奇的是例子，即故事；要与自己相关）。</p>
              <p>阻止好奇心的是保护已有模型的固执心（认为没必要学或已经学过，权威思维）。</p>
            </div>

          </div>

        </header>

        <section class="check-content">
          <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
          <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
          <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
          <div class="datamenu noselect">
            <span class="active" data-id="0">分析</span><span data-id="1">完成</span><span data-id="2">记忆</span>
          </div>
          <div class="datadetail">
            <!-- ① 分析层 -->
            <div class="analyseArea oneclip active">
              <div class="totalNumTxt">
                <p><b>全部</b>：共<b>0</b>项 / 耗时<b>0</b>分钟</p>
                <p class="btn priorityControl"><span>重要</span><span class="urgentbtn">紧急</span></p>
              </div>
              <div class="thoughtTip">思考：内容合理且合题→评级[A找优C找缺B找方法]→配合难度端心态，最耗时的找方法。</div>
              <div class="labelbtn toTagPart" title="进入标签管理">数据</div>
              <div class="labelbtn delbtn" title="清空所有分析数据">清空</div>
              <div class="analyseBtn noselect" title="选难度->看日常负重情况(点击猫咪取消难度选择)">
                <span class="cancelbtn"><img src="./static/baobao.png" alt="猫猫图标" /></span>
                <span class="starbtn" title="一星-简单"></span>
                <span class="starbtn" title="二星-一般"></span>
                <span class="starbtn" title="三星-有点难"></span>
                <span class="starbtn" title="四星-很难"></span>
                <span class="starbtn" title="五星-地狱级"></span>
                <span class="starStatus">全部</span>
              </div>
              <div class="knowfirst noselect">

                <div>
                  <span>客观地看</span>
                  <p>[方向]优先解决的任务合理吗？描述准确否，是否偏离源目标？</p>
                  <p>[障碍]记录的困难是否是问题的关键，做出的打算合适吗？这方法可好用？</p>
                  <p>“我没想到……，用……做……真棒，解决问题的关键在于……”</p>
                </div>
                <div>
                  <span>主观地看</span>
                  <p>[左] 难度(难度多是二三星才合理)：看日常负重情况</p>
                  <p>--- 难在哪，低-多熟练或多角度勤分析，高-多接触多练习，控制好各难度的量</p>
                  <p>[右] 完成度对应评级：评级递增红C蓝B绿A</p>
                  <p>--- A(绿色)越多=&gt;对自我能力的认知越清晰</p>
                  <p>--- A找优C找缺B找方法，配合难度端心态(不过于自谦or自傲)</p>
                  <p>[中] 重要紧急情况：观察量与耗时，重要不紧急的事多做些(50%↑)</p>
                  <p>[整体]用时：时间是用在点上了？</p>
                  <p>总结优缺点，避免低级错误，多找方法，把时间用精，提高自我认知和表达力，会抓关键点</p>
                </div>
              </div>
              <div class="tipclosebtn noselect" title="自我能力认知->根据计划和实际用时占比得出的评级">
                <i title="A - 找优点" data-level="A">A</i>
                <i title="B - 寻方法" data-level="B">B</i>
                <i title="C - 找缺点寻方法" data-level="C">C</i>
                <i title="无 - 点击恢复默认筛选" data-level="无">N</i>
                <strong class="summaryNum" title="总数：A级别数-B级别数-C级别数-无级别数">总:A-B-C-空</strong>
                <span class="labelbtn tipGuideBtn" title="阅读指南">指南</span>
              </div>
              <ul class="analyseContent">
                <li><b></b>
                  <div>无数据（另：筛选状态下可点击小猫清除状态）</div>
                </li>
              </ul>


            </div>

            <!-- ② 完成层 -->
            <div class="todoArea oneclip">
              <div class="thoughtTip">思考：目前平均每天完成？项，平均完成度是？与什么有关？</div>
              <div class="labelbtn toTagPart" title="进入标签管理">数据</div>
              <div class="labelbtn delbtn" title="清空所有完成清单数据，注意会影响上面的统筹数据">清空</div>
              <div class="searchTask noselect">
                <span class="datesortbtn" title="点击将按日期倒序或顺序排列">
                  <strong>0</strong>天 / <strong>0</strong> 项
                  <img src="./static/baobao.png" alt="猫猫图标" /></span>
                <span class="cleartxtbtn" title="清空输入">×</span>
                <input class="searchtxtIn" title="当内容为空时搜索即显示全部" type="text" placeholder="搜索关键字，支持Enter搜索" />
                <span class="searchbtn" title="当内容为空时搜索即显示全部">搜索</span>
                <span class="letterbtn" title="让连续字母亮起来">词</span>
              </div>
              <div class="todoWrapper">
                <div class="weekbtn noselect" data-index="-99"><span>本周</span><span>最近7天</span><span>上周</span>
                </div>
                <nav class="daymenu noselect"></nav>
                <div class="todoCon">
                  <div class="todoOut"></div>
                </div>
              </div>
            </div>

            <!-- ③ 记忆层 -->
            <div class="memoryArea oneclip">
              <div class="labelbtn toTagPart" title="进入标签管理，查看全部记忆内容">数据</div>
              <div class="labelbtn delbtn" title="清空所有记忆卡数据">清空</div>
              <div class="btn contentHiddenBtn"><img src="./static/baobao.png" alt="猫猫图标" /><span>开启主动回忆模式</span>
              </div>
              <div class="memoryDecorate noselect">运用是最好的记忆方法 [可隐藏内容]</div>
              <ul class="memoryCon"></ul>
              <ul class="memoryCon"></ul>
              <ul class="memoryCon"></ul>
              <ul class="memoryCon"></ul>
              <ul class="memoryCon"></ul>
              <ul class="memoryCon"></ul>
              <span class="btn memoryclearbtn">清除逾期项</span>
            </div>

          </div>

        </section>
      </div>

      <!-- 帮助页-->
      <div class="book onepart">

        <div class="book-outer">
          <div class="menustayback"></div>
          <ul class="bookmenu noselect" data-title="变量txtpartshow">
            <li class="active" data-id="0">插件内容介绍</li>
            <li data-id="1">把事情处理完</li>
            <li data-id="2">事件分类步骤</li>
            <li data-id="3">每日每周回顾</li>
            <li data-id="4">清单注意事项</li>
            <li data-id="5">特殊任务状态</li>
            <li data-id="6">学习误区排查</li>
            <li data-id="7">自我检测清单</li>
          </ul>
          <div class="bookCon">
            <!-- 栏目0：插件内容 -->
            <div class="txtpart active">
              <div class="textFrame">
                <p>【提示】除了本页（含有功能介绍和一些操作提示）外，本应用中含有一些提示按钮和文本，当鼠标停留在按钮会有功能提示，更多的帮助请看：
                  <b class="btn hotlink" onclick="toLink('https://www.yuque.com/nibaobao-youho/pqbrew/doitshow')">《快速上手》
                  </b>
                  <b class="btn hotlink" onclick="toLink('https://www.yuque.com/nibaobao-youho/pqbrew/doit')">《功能详解》
                  </b>
                  <b class="btn hotlink"
                    onclick="toLink('https://www.yuque.com/nibaobao-youho/pqbrew/zcmv7w')">《交流与下载-含常见问题》 </b>
                </p>
                <div>【清醒】不要舍本逐末，工具的意义就是提高效能，不要过于依赖应用本身的功能，要看如何使用它，以及它是否限制了你的使用？</div>
              </div>

              <h4>功能介绍</h4>
              <p><b class="decoration">① 清单处理 (基于GTD) </b></p>
              <p class="indent">清单分类：收集箱 执行|日历|等待|项目|可能 参考资料 回收箱</p>
              <p class="indent">检查内容：分析模块(记录进程-简版工作日志) | 完成模块 | 记忆模块</p>
              <p class="indent">其他：检查卡(目标或计划) | 完成卡 | 小本本(随记) + 日期倒计时 | 刷新任务 | 定期任务 </p>
              <p><b class="decoration">② 记录任务进程</b>--[启动页]确目标、定时间、定难度、计时、总结（提高自估能力，增强自我了解）</p>
              <p><b class="decoration">③ 数据整理</b>--事项分类&项目管理，问题记录，搜索记录(可开启)，内容查询(标签管理：#今天)</p>
              <p><b class="decoration">④ 数据统筹</b>--[检查页]近30天的打卡情况，初判任务数和任务完成度，可分析进程、完成和记忆数据</p>
              <p><b class="decoration">⑤ 签到&日历签</b>--[启动页]签到-距离目标更进一步；[日历签]采用日历累计内容</p>
              <p><b class="decoration">⑥ 自定义数据</b>--[设置面板]统筹难度，等级判定，内容数据，主题，搜索范围设置，偏好设置等</p>

              <h4>最新更新</h4>
              <p>【提示】日历清单项剩余天数在 链接和日期共存时 不显示。 </p>
              <p>
                <span>【修复】</span>签到添加按钮的误隐藏、多个桌面计时存在时关闭按钮点击无效的问题。<br />
                <span>【修改-快捷键】</span>[修复] 关闭窗口层由“Z”改为“Alt+Z”(只用Z会打断字母Z的输入)，添加日历/记录签的快捷键Alt+R(R表record)。<br />
                <span>【修改-主菜单】</span>[显示页面名称] 当非主页面激活时，最左边会显示页面名称，点击该名称可回到主页(点击已激活的页面按钮可回到主页或简版页)。<br />
                <span>【修改-输入框】</span>：新增支持b w1 w2 g1 g2 g3标志：①“b 内容”-搜索相近类似词；②“w1 问题”-在wikiHowTo搜索该问题；③“w2
                问题”-在topbook搜索该问题④“g1 歌名”-在酷狗搜歌；⑤“g2 歌名”-在网易云搜歌；⑥“g3 古诗文部分”-搜索古诗文内容。<br />
                [改动 + 显状态] 主页的输入框取消了搜索模式先激活再搜索的用法，改成点击后直接对框内容搜索；增加了当前搜索位置和记录状态的显示。<br />
                [增加特殊任务模式的快速切换] 弹出的书写框增加了“切”按钮，可自动把内容切换到特殊任务模式中（“清空”按钮能取消切换的内容）。<br />
                [增加内容转移]支持点击“&lt;&lt;”按钮把内容切换其他输入框进行处理。<br />
                <span>【修改-清空设置】</span>在大篇幅或内部数据删除清空前弹出提示。<br />
                <span>【修改-清单项操作显隐的开关】</span>为避免对笔头的理解冲突，每个清单的清单项操作的开关控制按钮已隐藏（默认是允许对每项的操作，想关闭这小菜单得先在设置面板上启用开关控制按钮）。<br />
                <span>【修改-完成刷新任务】</span>因为刷新任务可以是一个大类，单独分开写难以寻找，一大类的完成在后期查看又不知完成的是哪个，故在点击ok按钮后，增加对内容再编辑这一步。且按照提示处理内容（前置#并用+号区分标签和内容）可同步到日历签的习惯日历中。<br />
                <span>【修改-主编辑页折叠按钮】</span>因使用频率不多，但存在感强，现已将该功能合并在右下角回到顶部的按钮里--双击即可。<br />
                <span>【新增①-桌面计时】</span>增加暂停/继续计时按钮；停止按钮-重新计时；非原定的倒计时状态时，可开启番茄计时，默认25+5分钟提醒(具体可在设置面板上修改)。<br />
                <span>【新增②-日历签】</span>位于中间弹出窗口（习惯 收入 支出 特殊--默认加载签到与定期任务）。<br />
                <span>【新增③-自我检测】</span>帮助页增加了《自我检测清单》栏目，添加了年月周的天数进度。<br />
                <span>【新增④-界面简化】</span>隐藏简版页数据处理框，主页清单列表的叠起和展开功能纳入右下角回到顶部按钮(双击)，检查页头部双击可切换隐藏或显示。<br />
              </p>
              <br />
              <h4>省事操作</h4>
              <p><strong class="decoration">快捷键(Alt+ASDCWBTQIRZ|0123):</strong> </p>
              <p>
                【打开快捷键<span>Alt+</span>】<span>C</span>检查页(check)，<span>W</span>书写框(write)，<span>B</span>收集箱(box)，<span>T</span>标签管理(tag)，<span>Q</span>问题记录(question)，<span>I</span>项目管理(item)，<span>R</span>日历/记录签(record)
              </p>
              <p>【内容快捷键
                <span>Alt+</span>】<span>Enter</span>清单添加或小本本项添加，<span>D</span>快速添至执行清单(do)，<span>S</span>站外搜索
                | <span>T</span>站内搜索（主编辑页输入框 &gt; 书写框）
              </p>
              <p>【关闭快捷键
                <span>Alt+</span>】<span>Z</span>关闭中间弹出面板+书写框+总结面板+设置面板，<span>A</span>关闭其他回到主页(点击页面名称也能达到同样效果)
              </p>
              <br />
              <p><b class="decoration">书写框</b>--<span>多项添加</span>[用*间隔多项或换行再点击“自动处理”按钮]
                (<span>附加文本操作</span>：加日期，加链接，加紧急重要标志，清空-优先去掉日期和加紧急重要标志)
              </p>
              <p>“自动处理”除了整理为多项还支持：<br /><span>① 处理‘-’间隔的项（前置---）；② 可为记忆单词的英文加上[]（前英文后中文需前置[]，前中文后英文需前置-[]）③
                  @标志添加到每项中，作为项目项</span></p>
              <br />
              <p><b class="decoration">搜索功能</b>--<span>书写框|主输入框</span> 可直接对清单项/优先解决内容搜索，含链接的搜索只会取文本部分搜索</p>
              <p>【对外】可指定搜索范围，另：翻译(前置a)/近邻词(前置b)/在wikiHowTo或topbook里解决办法(前置w1或w2)/搜歌(前置g1或g2)/古诗(前置g3) 注意标志后有空格</p>
              <p>【对内】<span>标签模块(对内-已有数据搜索及下载)</span>给搜索结果形成快捷标签，并提供编辑与下载，方便以后查看(其中<span>搜索项目该用@@项目编号</span>)</p>
              <p>【百度/谷歌搜索技巧：+必含词 -不含词 “限定整词” site:域名 intitle:标题词 inurl:链接词 filetype:文件格式 20xx..20xx某时间段内】</p>
              <br />
              <p><b class="decoration">utools支持的功能</b></p>
              <p><span>桌面计时挂件</span>--如果不分离插件，切记不勾选“隐藏插件后完全退出”。</p>
              <p><span>主输入框的文本</span>--可通过激活“事项获取/记问题/桌面计时”直接复制到书写框。若文本后带？问号，则同时写入问题记录；若输入格式为“tt0|提示内容”则仅添加桌面计时挂件
              </p>
              <p><span>文件夹链接</span>--支持文件夹路径作为启动页的自定义链接（可贴到别处）[ 辅助操作：选中文件夹后长按右键或utools的输入框里输入文件夹路径 ]</p>
              <br />
              <p><b class="decoration">各页面功能</b></p>
              <p>主页[默认]--<span>(各清单事项输入)</span>--主输入框支持基础的清单项的输入与搜索，而参考|记忆项|检查卡|小本本和特殊任务需要书写框的输入。</p>
              <p>简版页<span>(可导入导出数据)</span>--设置面板中可简化输出处理数据(支持.md格式-只处理首个链接)，支持备份数据导入，支持迁移用户数据(json)；数据显示区小工具功能增强：①
                支持仅对选中文本操作修改; ② 替换值的特殊输入表不同功能，如<span>@ZZ单词转大写 @zz单词转小写 @Zz单词首字母大写</span>。</p>
              <p>资源页<span>(可自定义添加链接)</span>--供参考，不定期更新；自定义链接可加载到参考资料，也可贴在卡片标题上(会显示小猫) </p>
              <p>启动页--<span>倒计时提醒(贴桌面)</span>，设置面板中自定义休息时间，记录溜号时间</p>
              <p>检查页--完成清单<span>(可内容|日期查找|点击日期圈圈查看)</span>--可看做事相关概率</p>
              <p>检查页--记忆模块<span>(可主动回忆)</span>--今日刚记忆的内容，来日按遗忘曲线（1,2,4,7,15天）呈现，提醒温习</p>
              <p>
                帮助页--插件介绍，GTD相关内容介绍，每日每周回顾指引，特殊任务展示（日期倒计时|日刷|周刷|月刷|定期任务）--<span>记录与修改重复或定期的事</span>，学习误区排查，自我检测清单。
              </p>

              <h4>使用方法</h4>
              <p><span>[做事]</span> 温习记忆模块内容，做今日规划，捕获事件将其归类并按重要性排序-完成事项</p>
              <p><span>[复盘查看]</span> 简版页数据-数据整理-另存 （除杂-清楚什么是没必要的）</p>
              <p><span>[复盘分析]</span> 分析清单-完成自估，完成清单-每天的量与度是否合理，签到-最特别的点，小本本-小想法，参考资源整理-分析资源，搜索记录&问题记录-分析解决问题的思路
              </p>
              <p><span>[周复盘]</span> 签到-打卡方向，检查卡-写中期目标，等待清单（主动出击） 项目清单（主动将其拆解） 可能清单、回收箱（是否有变动）</p>
            </div>


            <!-- 栏目1：GTD处理完事情 -->
            <div class="txtpart">
              <p class="right">整理自 Topbook <b class="btn hotlink"
                  onclick="toLink('https://topbook.cc/course/detail/153')">《重新认识GTD》 </b>系列文 </p>
              <h4>GTD：just把事情处理完/做好，not把事情做完</h4>
              <p>需要达到的目的：</p>
              <p class="indent">a. <span>记录下来，让大脑清空不混乱</span></p>
              <p class="indent">b. <span>让自己随时都能明确知道，下一步该做什么</span></p>
              <p>除机心(特指机巧功利之心)：人类的聪明在于会工具，容易犯的错误是只会工具。别让工具玩了你。做计划是为了更好的实际效果，带有强目的性，<span>不是为了计划而计划，是为了做事！</span>
              </p>
              <p>
                <span>权衡利害关系</span>。重点不一定是我得到了什么，因为得到什么有时候反而是非常明显的，<span>更可能是因为此会失去什么？</span>我能否承受这种失去？比如纪念日？某个自己独处思考的时间？(珍惜时间-&gt;做距离自己目标更近的事情)
              </p>
              <p>多思考多规划：比如，为什么不能完成所有的事情？那些做成事儿的人难道不都是能够严谨、努力要求自己今日事今日毕的吗？那么我的目标是什么？应该怎么确定自己的目标呢？</p>
              <p>
                <span>鼓励思考，不鼓励庸人自扰</span>。用线性思维去看非线性世界是愚蠢的。就像不输掉一盘棋的办法是不去玩(毕竟“不输掉一盘棋”和“如何赢一盘棋”不是对等的)，不符合逻辑的事多的是，别钻牛角尖。
              </p>
              <p>思考的时候你可以天马行空，<span>行动的时候，你必须脚踏实地</span>。</p>
              <p>
                <span>问题从面线点逐渐分解：</span>比如“如何做思维导图公开课”的方案：确定一个选题范围，是技能型为主，还是做一些心法？在这种选题范围内，大致涵盖哪些要点？去哪些地方搜集辅助资料？大概花多久时间写出脚本？多久时间制作完成……
              </p>
              <p>
                <span>以小见大，构成体系</span>：一个小小的任务清单，最终牵扯出来的，仍然可能和个人目标、处事方式有重要的关联。因为只要你愿意多问自己问题，你就能牵扯出一张网，这张网就是很多人说的——体系。
              </p>
              <br />
              <p>如果一个普通人需要处理的事情多到无法处理，是否应该反思下，是不是要得太多了？</p>
              <p class="indent">①
                <span>逆向思维</span>如果你确实不知道自己该做什么，不如先问问自己不能做什么（这是一位老先生的话）；不去想做什么，该想不做什么。不要老想着做事情，而是享受自己的存在。
              </p>
              <p class="indent">② 依然<span>把需要做的事情按目标权重排序</span>，然后有时间就做距离目标比较近的事情，做不完没关系，反正你也做不完所有事情；</p>
              <p class="indent">③
                把所有需要做的事情做一个<span>价值排序</span>之后，只取排行榜上前面十件甚至五件，后面不管是什么，都不要再去管它们，时间会让你知道，不管你做没做其他事情，地球照样运转。</p>
            </div>

            <!-- 栏目2：事件分类 -->
            <div class="txtpart">
              <p class="right">整理自 Topbook <b class="btn hotlink"
                  onclick="toLink('https://topbook.cc/course/detail/153')">《重新认识GTD》 </b>系列文 </p>
              <h4>前提须知</h4>
              <p>清单有很多种：计划 总结 书单 备忘 收藏 随感……但不管怎么分，内容都可以分为两种——要做的和其他的</p>
              <p><span>要做的</span>--放在收集箱，进而分类，进入五个清单(执行|日历|等待|项目|可能)</p>
              <p class="indent">特殊的可在设置中安排为刷新任务（每几天都要完成一次）和定期任务（仅作提前提醒）</p>
              <p class="indent">事项除了从如何完成角度进入五个清单，它本身也具有多维度，为了更好划分，在输入时<span>加前缀，如s-学习、l-生活、w-工作</span>
                （日后可在标签中搜索查询）
              </p>
              <p><span>其他的</span>--那就记录（起提示、备忘、碎片收纳作用），记录分主内和主外的</p>
              <p class="indent"><span>主内是协助使用该应用的</span> 比如说 检查卡，参考资料，自定义链接，定期任务的输入让做事更稳妥；打卡，进程分析，项目数据的收集统计让分析更明朗
              </p>
              <p class="indent"><span>主外是做临时记录</span>应该用外链连接并整理输出，如完成清单、随感-小本本、 记忆内容、问题记录&搜索记录、收藏(参考链接+自定义链接)等</p>
              <p class="indent">至于书单这类纯记录的东西(如大量笔记)——不需要处理的东西，如有必要请选择链接进来</p>
              <h4>事件分类【明晰与组织】：让精力集中在想要的方向上</h4>
              <p>下面处理的都是要做的事，主要分五步：</p>
              <p><span>收集/主动捕获--明晰/强调结果--组织--计划的同时更强调回顾--执行更强调与执行对象的联系（人性化-拿结果）</span></p>
              <p class="indent">注意①：2分钟可以搞定的请立刻做，不需要安排进来。</p>
              <p class="indent">注意②：属于成熟系统内的事项可以直接写入执行清单，如作为学生的任务是做完一张数学卷。</p>
              <p class="indent">收集到的事项不是每项都要立马执行的，可通过下面的提问归类为在七个清单中（执行清单，日历清单，等待清单，项目清单，可能清单，参考资料，回收箱）。</p>
              <br />
              <p>Q1：可行动吗？（if not： <span>可能清单</span>，<span>参考资料</span>，<span>回收箱</span>）</p>
              <p>Q2：能一步搞定吗？（if not：<span>项目清单</span>[下一步？做规划/做方案]）</p>
              <p>Q3：该我做吗？</p>
              <p class="indent">if not：<span>等待清单</span>[标明事项，时限，可能的执行事项，特定时机确认。分析可能情况，主动确保这件事能够被顺利完成，配合闹钟]</p>
              <p>Q4：特定时间？（if not：归入<span>执行清单</span>）</p>
              <p>Last：调闹钟或写进日历，写入<span>日历清单</span></p>
              <br />
              <p>
                <span>【如何决策-决定优先级】</span>同一清单的项也存在优先，最优的做法是事情与目标达成充要条件的集中精力认真做，达成必要条件的持续做，达成充分条件的尽量少做，坚决不做不充分也不必要的。
              </p>
              <br />
              <p><span>【提醒】</span>对于复杂的内容不妨建个知识库作为项目，在刷新任务中添加对应链接就方便很多了。</p>
            </div>

            <!-- 栏目3：每日回顾 -->
            <div class="txtpart">
              <p class="right">Topbook <b class="btn hotlink"
                  onclick="toLink('https://topbook.cc/course/detail/153?selectedSection=92')">《全局复盘-GTD五个流程》 </b>的整理与运用
              </p>
              <h4>day回顾(2次)：起始 and 终结</h4>
              <p>每日的流程是：事项捕获 -&gt; 回顾 -&gt; 事项处理 -&gt; 回顾</p>
              <br />
              <p>首次回顾【<span>简版页</span>】：温习（<span>记忆模块</span>）与清晰实践水平（<span>完成进度</span>），做个规划</p>
              <p class="indent">① 对捕获来的事项进行<span>清单分类并输入</span>（详见片段文<b
                  class="btn hotlink jumptoknew">《事件分类步骤》</b>或进入<span class="btn jumpboxbtn"> 收集箱 </span>熟悉步骤）</p>
              <p class="indent">② 对事项进行<span>优先序排列</span>(按个人追求)，必要时可加紧急加重要标志(更细致地分可加上前缀
                s-study表学习，l-life表生活，w-work表工作)</p>
              <p class="indent">
                <span>尤其评判该事与目标的关系</span>：充要条件--集中精力认真做；必要不充分条件--持续做；充分不必要条件--尽量少做；空无条件--坚决不做（其中必要条件B-&gt;A，充分条件
                A-&gt;B）
              </p>
              <p class="indent">③ 可选：对事项进行<span>难度分级</span>(添加ABCD)： [<span>A看似简单</span>-多角度勤分析]
                [<span>B简单却耗时</span>-效率] [<span>C看似困难</span>-勤接触][<span>D多余</span>-少做]</p>
              <br />
              <p>再次回顾【<span>检查页</span>、<span>总结面板</span>和<span class="btn jumptagbtn"> 标签模块 </span>的#今天】：</p>
              <p class="indent">① <span>要事分析</span>不可少，评级量自估，对症下药(改描述寻方法)</p>
              <p class="indent">② <span>完成清单</span>，每天的量与度，找找规律，是否合理？</p>
              <p class="indent">③ 可选：<span>记忆模块</span>主动回忆模式下加深记忆(配合第一人称形象联想)</p>
              <p class="indent">④ 可选：<span class="btn jumpdakabtn">签到 </span>最特别的点，一是看毅力，二是看近期侧重，总方向不走偏</p>
              <p class="indent">⑤ 可选：分析整理<span>小本本</span>琐碎的想法、<span>参考资源</span>（构建个人知识库）</p>
              <p class="indent">⑥ 提示：在标签模块的<span>#今天</span>能直观看到今天的操作结果，再结合<span>小本本</span>把笔记整理出来</p>
              <p>
                最后【<span>简版页</span>】：未完成的事项中哪些不做了，哪些需简化任务或腾出专门的时间？点击“复制处理数据”按钮，保存并整理完成事项等其他数据(更多的操作可在<span>标签模块</span>中编辑和下载)。
              </p>
              <br />
              <p>回顾了今天，在个人历史上定格了今天，再展望下明天。</p>
              <p class="indent">项目清单：主动拆解并谋划执行方案，把大项目拆解成小步骤，并分解到其他清单当中，明确下一步是什么？正在做吗？做得怎么样了？</p>
              <p class="indent">可能清单：自己主动去思考事情的可行性有多大。把思考这件事，也放进执行清单。（思考：why when how how much effect-where who
                what）
              </p>

              <!-- 栏目：每周回顾 -->
              <h4>week回顾：更想要 更喜欢 更应该</h4>
              <p>目的：检查科学性（私人订制） + 查漏补缺 + 主动收集</p>
              <p>
                【更应该】<span>自估能力提高</span>：什么事你认为难其实不难，什么事你认为简单其实容易进坑，表里如一的事就直接干，不然请不要让心理这个小九九来自添难度或自我降智。<span>更客观地认识和分析问题。</span>
              </p>
              <p>
                【更应该】<span>自我认知提高</span>：每天大概能做多少事？工作量是否在自己能力范围内？哪些事耗时-善用工具或其他帮助？哪些事多余-减少不必要的时间牺牲？<span>事不在多在精，量力而为，调整计划，向提高进度百分比看齐。</span>
              </p>
              <p>【更喜欢】做哪方面的事更顺手？计划好 or 心情好 or 偏好？<span>培养自信心，让它成为擅长。</span></p>
              <p>【更想要】余生是倒计时，大部分时间用在我想前行的路上，小部分时间用在卸下包袱，放松休息。</p>
              <br />
              <p> <span>制定检查清单</span>-与刷新任务不同，检查清单可以是抽象判断，刷新任务则必须是可执行的事项，因为会计入当日的任务量。</p>
            </div>

            <!-- 栏目4：注意事项 -->
            <div class="txtpart">
              <p class="right">整理自 Topbook <b class="btn hotlink"
                  onclick="toLink('https://topbook.cc/course/detail/153')">《重新认识GTD》 </b>系列文 </p>
              <h4>执行提示：万事开头难，害怕解决不了问题</h4>
              <p>前提：保障自己有充足的睡眠、健康的身体，而且不能牺牲合理的人际关系、个人幸福感</p>
              <p>切记：量力而为——<span>你不可能完成所有的事情 ，尽可能做离你目标更近的事情</span></p>
              <p>执行的注意点：</p>
              <p class="indent">①
                <span>执行清单的事项是你可以一步搞定的</span>。如果不是因为自己态度和能力有问题，而是因为事件特殊用时较长，得知道“事情头疼并非因为它难，因为我们很少接触，误以为难”
              </p>
              <p class="indent">② 必修课：<span>不管好坏，起码愿意做计划、做方案</span>。不是说非得把方案做多好，而是在这种主动意愿下每次都有小进步
              </p>
              <p class="indent">③ <span>做好时间预估，为特别的事件预留时间</span>，可以<span>变通</span>，找别人帮忙</p>
              <p class="indent">④ <span>在你有限的生命里，有些事没必要做</span>，它该待在回收箱里(毕竟你不可能完成所有的事情，它微不足道)</p>
              <p class="indent">⑤ 保证质量和效率：<span>一次只处理一件事情，定时(番茄时间)，打破负罪感幻觉</span> </p>
              <br />
              <p>参考资料：万物皆可参考，但参考价值的高低是相对的</p>
              <p class="indent">① <span>回归常识，回归自我</span>，避免追新、奇、怪</p>
              <p class="indent">② <span>提高信息的检索、辨别能力</span>；人找书很难，但书找书却很容易，多看多用多思考，学检索方法也要学辨别好坏，不要忘了回归常识</p>
              <p class="indent">③ <span>提高参考资料的存档标准</span> ( 不存档能搜到的、浅显而平常的、换汤不换药的如某些新概念 ) </p>
              <p class="indent">④ 现代人的参考资料: a. 网络搜索引擎；b. 个人知识库（工作所需与智慧或对智慧的见解）</p>
              <p>其他方法：要事第一 四象限法则</p>
            </div>

            <!-- 栏目5：特殊任务 -->
            <div class="txtpart refreshpart">
              <div class="countdownCon">日期倒计项：
                <span class="countdownconTxt">（暂无）</span>
                <button class="btn setCountdownbtn" title="更改日期倒计时" type="button">改</button>
              </div>
              <div class="piece">
                <button class="btn setTaskbtn" data-index="4" title="更改日刷新任务内容" type="button">改</button>
                <div class="title">日刷新任务<i class="status"> (未开启)</i></div>
                <ul class="refreshUl"></ul>
              </div>
              <div class="piece">
                <button class="btn setTaskbtn" data-index="5" title="更改周刷新任务内容" type="button">改</button>
                <div class="title">周刷新任务<i class="status"> (未开启)</i></div>
                <ul class="refreshUl"></ul>
              </div>
              <div class="piece">
                <button class="btn setTaskbtn" data-index="6" title="更改月刷新任务内容" type="button">改</button>
                <div class="title">月刷新任务<i class="status"> (未开启)</i></div>
                <ul class="refreshUl"></ul>
              </div>
              <div class="piece regularpart">
                <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
                <div class="title tasktitle" title="从旧到新排列，新项添加时默认开启提醒，不计入任务数量的计算">定期任务<i class="status"> (提前<em
                      class="taskMentionNum" title="该数值可在设置面板中自定义">3</em>天提醒)</i><span class="btn taskaddbtn"
                    title="新增项">+</span></div>
                <ul class="regularUl"></ul>
                <div class="passline hidden"></div>
                <ul class="regularUlPass"></ul>
              </div>
            </div>

            <!-- 栏目6：学习误区 -->
            <div class="txtpart">
              <p class="right">整理自 YJango 的视频
                <b class="btn hotlink" onclick="toLink('https://www.bilibili.com/video/BV1aS4y1X7eY')">《不良学习误区自我排查》 </b>
                或
                <b class="btn hotlink"
                  onclick="toLink('https://www.modevol.com/episode/ckx8eb99w000501l2ewyt2kto')">《渐构--断墨寻径》 </b>
              </p>
              <h4>学习的误区有哪些？究竟该如何学习？</h4>

              <p><span>如何学习：保证睡眠，有效背诵，挑选合适的材料(瓶颈)，有效训练，明确目前状态，以教促学(巩固)。</span></p>
              <br />
              <p>【知识点】：（本文的记忆和学习都是一种行为）</p>
              <p class="indent">
                学习的目的是解决从未见过的新情况(泛化)，所以要建构规律，用规律来生成从未见过的新情况。而考试与做题考查的是利用大脑的现成结构(即规律)去解决新情况，从而验证结构(规律)的完整性，进而调整大脑结构(规律)。
              </p>
              <p class="indent">知识的存储：只要通过有效的训练，给大脑提供合适的材料，并保障足够的睡眠，大脑便可以自己形成规律(结构)。此规律不保证一定正确，需要后期不断反馈进而调整。</p>
              <br />
              <p>【解除误区，了解本质】：</p>
              <p><b class="decoration">★ 背与学</b> --文科全靠背，理科全靠学？</p>
              <p class="indent">
                当然不是，选择背诵还是选择学习，跟目标有关，以<span>重现</span>为目标则<span>靠记忆</span>，以<span>泛化</span>(解决未记忆的新情况)为目标则<span>靠学习</span>。
              </p>
              <br />
              <p><b class="decoration">★ 听课无用</b> --明明上课认真听讲，为何考试却不会？为什么一看就会，一做就废？</p>
              <p class="indent">
                上课认真听讲只能算是学习方式中的一种——<span>指令学习(依赖语言，难懂但精确)</span>，而自古以来动物最常用最容易的学习方式是<span>归纳学习(大脑无意识控制，容易以偏概全)，也就是通过做题、实践来感知差异与共性从而建构规律</span>（如首次使用遥控器靠多次尝试而不是看说明书）
              </p>
              <p class="indent">应试生正确的学习方式应该是：<span>反复 指令学习(规范-确定规律的大概) +
                  归纳学习(训练大脑形成合适结构)</span>，既要上课听讲，也要课下<span>有针对性地做题练习(对大脑进行有效训练——实际执行[刺激细胞-做准备]和反馈答案)</span>，对新的指令性材料(概念、公式等)进行<span>精细加工——扩充新例&联系旧构建的内容(把书读厚)</span>。
              </p>
              <p class="indent">
                “一看就会，一做就废”当然是因为光看对大脑形成结构的作用微乎其微，你觉得你会了，是因为大脑短时间记住了(背下来了)，不说时间一长就会自动遗忘，这种会也只是会你看过记忆过的情况。从验证角度讲，光靠看(哪怕背下来了)形成的结构是没有边界的结构，只知道延伸(可以有哪些路)，不知道堵塞(哪些是死路)，唯有通过做题、实践去验证脑中的结构，才会让大脑结构(规律变得更具通用性)调整为普遍性结构，而非原本的过拟合结构。
              </p>
              <br />
              <p><b class="decoration">★ 做题无效</b> --做了那么多题，成绩还上不来？</p>
              <p class="indent">勿忘了做题的目的，做题既是为了检测当下大脑现有结构(规律)的完整性(通过答案反馈)，又是给大脑提供学习材料，对大脑进行一次有效训练。</p>
              <p class="indent">
                做题达不到效果，要么<span>材料不对(题目不完整-非有效材料/选错了题-如面临材料瓶颈|模型瓶颈)</span>，要么<span>做题的方式不对(需用有效训练：实际执行&反馈答案)</span>实际执行体现为每道题都思考一遍，哪怕没思路，这样做是为了刺激大脑对应的细胞做好构建结构(规律)的准备工作。
              </p>
              <p class="indent">
                若只是思考没有反馈答案，那么大脑依然不知道怎么调整结构；若没有做题时的思考只看答案和思考答案，那么大脑结构就只会增加新分支，而无法通过反馈来排除结构里的错误分支，下次遇到此类题的时候，还是有可能运用错误分支解答。
              </p>
              <br />
              <p><b class="decoration">★ 使用效果不佳</b> --明明知识都学会了，为何还是做错？学了那么多的道理，为何过不好？</p>
              <p class="indent">
                当真学会了？在归纳过程中，脑中结构(即规律)连旧题都不能解决的情况叫<span>欠拟合(说明需要多练习)</span>，只能解决旧题却不能解决新题的情况叫<span>过拟合(说明需要收集更多新经验&让规律更具通用性)</span>
              </p>
              <p class="indent">
                即使真的学会了，也不是能到处用的。因为<span>知识具有可泛化性且拥有有效范围</span>。这就说明，生活中的一些道理其实只是某案例的经验，不具有泛化性，也就不是知识；某些心理学哲学的概念也是有使用前提的，不能乱套用。
              </p>
              <br />
              <p><b class="decoration">★ 难输入-选材</b> --听不懂看不懂是能力不行？</p>
              <p class="indent">
                无关性别、能力与天赋，听不懂看不懂就是该材料不对。<span>有效材料应该是：指令材料里的相关概念和公式都已掌握，实例材料都具有完整的因果或问答。</span>所以不必为别人懂而自己不懂而焦虑，找到合适的有效的材料才是正解(必要情况可拆分问题再找材料)。
              </p>
              <br />
              <p><b class="decoration">★ 无厘头-选材</b> --难题都能解决了，为何简单的题总出错？为何别人能轻松解决，自己反而觉得难？为何玩了五年游戏，还是那么菜？</p>
              <p class="indent">瓶颈-分为<span>材料瓶颈(扩充新材料)</span>和<span>模型瓶颈(用实例去解除抗拒)</span>。</p>
              <p class="indent">
                想象构建规律的过程是收集卡牌，当收集得越多重复率越高，也就会出现材料瓶颈，故专攻难题和专攻简单而变换多样的题都会收集得不完整。别人能轻松解决但自己不能是因为别人已经收集到了对应的卡牌，而自己没有。
              </p>
              <p class="indent">
                不同于宝宝对新事物的好奇和接受程度，构建的规律越多越“完整”对同属该范围的新规律碎片排斥性越大。故辩论里常用的技巧是不跟对方争论，而是直接抛出一个新情况，让对方用现有的认识来预测结果，再展示给对方他的预测结果不符合实际情况。
              </p>
              <br />
              <p><b class="decoration">★ 过分努力</b> --牺牲睡眠，争分夺秒地学习不对吗？力求当场学会任何知识不对吗？</p>
              <p class="indent">
                确实不对。这和知识如何在大脑中存储有关。首先这需要时间，大脑不是电脑，知识存储也不是直接复制粘贴，<span>大脑大多会选择在睡眠时间进行调整，形成结构</span>。这过程不受我们直接控制，保证睡眠时间就尤为重要。其次，<span>对于每次形成的结构，大脑并不保证它一定正确，需要进行多样的有效训练来调整（即多次迭代才形成合适结构）</span>。这就决定了知识难以一蹴而就，当场学会。
              </p>
              <br />
              <p><b class="decoration">★ 学了总忘-学以致用</b> --为什么学完就忘，到底怎么复习？</p>
              <p class="indent">
                切记学习的目标是泛化，我们需要努力在脑中构建合适的规律去解决新情况，而不是靠记忆旧情况去解决旧情况。自动遗忘是构建规律的利器，它帮助验证目前大脑结构(规律)的完整性。
              </p>
              <p class="indent">至于复习，也就是巩固已有的结构，当然是用新情况反馈，告诉大脑结构已经完整了，不需要遗忘了。常见方式就是<span>以教促学(举个例子-新例预测 &
                  换个说法-表述转换)</span>。</p>
              <p class="indent">另外，可把当天学习的内容梗概/链接/笔记位置放入记忆模块里（记忆模块会显示大脑当天将要遗忘的内容），这样每天花时间温故一下就记得更牢了。</p>
              <br />
              <p>
                此外，还会有其他问题需要解决：如何听课？如何做笔记？如何找学习材料？如何快速记忆？（一个身心健康、精神专注、目标明确、思路清晰、不断积累和总结经验、善于联想和运用的你。切记：别人100个方法都比不过你自己实践摸索出的方法）
              </p>
            </div>

            <!-- 栏目7：自我检测 -->
            <div class="txtpart">
              <div class="textFrame">
                <p>今年过去了<b class="pastDay">多少</b>，这个月过去了<b class="pastDay">多少</b>，本周过去了<b class="pastDay">多少</b>。
                </p>
                <p>人生不过3万多个日夜（80岁共29220天 | 27岁近1万天），且行且珍惜。</p>
                <p>吾生也有涯，而知也无涯。以有涯随无涯，殆已！ <b style="float: right;">——《庄子·内篇·养生主》</b></p>
                <p>人无远虑必有近忧；学如逆水行舟，不进则退——给生活加点‘苦’，每天进步一点点。</p>
              </div>
              <h4>日常检测</h4>
              <p><b class="decoration">良好的习惯（小事做起-自信）</b> <b class="btn hotlink"
                  onclick="toLink('https://weread.qq.com/web/bookDetail/92b3225059b41292bed0364')">《习惯的力量》 </b> </p>
              <p class="indent">习惯形成的三要素：A.线索 —&gt; B.行为 —&gt; C.奖励</p>
              <p class="indent">A.线索 when用这个习惯，构思习惯行动前的触发场景(5方面：①时间 ②地点 ③情绪 ④周围的人 ⑤前面发生的事)</p>
              <p class="indent">B.行为 do what，做些什么来解决问题，把坏习惯替换掉，意外发生如何安排</p>
              <p class="indent">C.奖励 行为完成后可获得自然奖励(甜品&多巴胺，运动&内啡肽) 或 规则奖励(如番茄时钟每30分钟内最后5分钟的休息)</p>
              <p class="indent">【个人】①②背部晒太阳 | ①成人每天喝水1.5~2升 | <u title="给大脑整理信息的时间">①②午睡40分钟</u> | <u
                  title="(对他人带来的-不接受)世间没有真正的感同身受，别人的看法、指责和批评要理性看待，就事论事，细想想别人为什么跟你这么说。你不需要给每一个人去解释，甚至获得他们的认可，没必要。做自己，做懂自己的人，你会不会接受只是你的事，你要为自己负责，若每个意见都采纳，我想机器人都会恶化成矛盾的恶魔。同时自己也不要成为这种“想改变别人”的人。">③④稳定情绪</u>-
                <u
                  title="(自己制造的/倒霉-反思太闲了？)有些痛苦是你太专注想太多而放大了的，毕竟世间那么多不可为不可料之事，意外可以是惊喜也可以是惊吓，事情都有两面性，你把坏的无能为力想得再多也无用，更重要的是当下还有未来。行动起来吧，别轻易让10秒的心情搞坏你的一天，想必不是自虐狂吧，别管太多，想太多，时间花在你在意的人和在意的事上不好吗？">改善生活</u>
                | ①③④热爱运动 | ②阅读与分析 | 学习生活有条有理 | ①②⑤不熬夜
              </p>
              <p class="indent">【交集】 不拖延 | 合理利用时间 | 乐于合作（信任与欣赏） | 互助分享 </p>
              <p><b class="decoration">身体锻炼（耐力与爆发力 =&gt; 用进废退）</b></p>
              <p class="indent">冥想，眼操，捏耳，按摩头皮，放松脖子，手腿腰(拉伸，手脚指操)，扩胸挺背，饮&食，跑步&军体拳</p>
              <p class="indent">口鼻舌(呼吸-<u title="呵-心，呼-脾，呬(读音同细)-肺，嘘-肝，吹-肾，嘻-胆">六字诀</u>|普通话朗读|
                <b class="btn hotlink" onclick="toLink('http://rkl.intowz.com/')">绕口令 </b>|模仿：
                <b class="btn hotlink" onclick="toLink('https://open.163.com/ted/')">TED演讲 </b>，辩论赛，脱口秀|唱歌练气，口腔操)=&gt;
                可抄写一份材料
              </p>
              <p class="indent">以期达到：<span>练发音-咬字清晰，练气息-声音铿锵有力 | 练记忆-能背诵，内容复述能力 |
                  练语言表达-做到言简意赅，培养幽默感、说服力</span>，试着完整讲个故事、笑话或唱一首歌</p>
              <p class="indent"><span>[深呼吸]</span> 鼻吸气5秒鼓腹 =&gt; 屏气5~10秒 =&gt; 慢慢吐气收腹 =&gt; 停顿1~2秒 (反复10分钟)</p>
              <p class="indent"><span>[腹式呼吸]</span> 感受腹部起伏 & 想象嗅花 & 想象目标肌群的运动 =&gt; 做到呼吸轻、细、深、长</p>
              <p class="indent"><span>[运动呼吸]</span> 慢吸快呼(20次+) | <span>[睡眠呼吸]</span> 躺床闭眼深呼吸的同时，双手由平放身体两侧 =&gt;
                吸气屏气过程举过头部，紧贴两耳 =&gt; 快要吐气时双臂同时还原 (反复10次助眠) | <span>[静呼吸] </span>单鼻孔训练-想象空气是朝前额流-屏气10秒</p>
              <p class="indent"><span>【肺活量增加】</span>除了增加呼吸，还有扩胸运动-向两侧50次+ <span>|</span> 伸展运动-向上30次+
                <span>|</span> 慢跑-不憋气 <span>|</span> 游泳-憋气 <span>|</span> 腹式呼吸-30分钟（注意：拉伸时吸气&动作恢复时呼气）
              </p>
              <p><b class="decoration">良好的态度</b> 自信、自尊、自立、乐观、坚韧、勇敢、进取、勤奋、珍惜时间、注重行动、负责、宽容 =&gt; 自知 自制 </p>
              <p><b class="decoration">对学习的要求</b></p>
              <p class="indent">【态度】善于发问反思钻研，喜欢挑战，敢于质疑，敢于创新；懂得主动学习(基于学习方法)，自我加压</p>
              <p class="indent">【实践】懂得分而治之，纳入系统学习 =&gt; 按计划学习，专时专用、讲求效益(速度与质量)，合理把握学习过程，学以致用，温故而知新</p>
              <p><b class="decoration">合理利用时间</b>--做事时全神贯注，休息时放松身心</p>
              <p class="indent">有时间观念-再重要的事也要定个期限，那是你能力范围内能做到最好的所需时间</p>
              <p class="indent">见缝插针随时随地，利用闲散时间进行学习（多场景易记忆也更轻松）</p>
              <p class="indent">时间规划-大的目标或任务需要进行规划并及时调整（优化执行）</p>
              <p class="indent">注意整理，让每件有用的东西伸手可及，学习的东西更是如此省时（省时，快速进入状态，减少干扰）</p>
              <p class="indent">在学习到一定程度后注重休息和补充能量（学习有张驰）=&gt; 保持愉快的心情和精力充沛的身体</p>
              <p class="indent">充足的睡眠7~8小时，不要熬夜，定时就寝。中午坚持午睡 =&gt; 饱满的精神</p>
              <p><b class="decoration">做事（含学习）</b>--发挥主观能动性</p>
              <p class="indent"><span>1. 目标</span>明确，善于安排，先干什么后干什么</p>
              <p class="indent"><span>2. 专注</span>做事(投入多少)</p>
              <p class="indent">身心状态，学习的场景与环境 <span>|</span> 调用了多少器官-积极主动[理解-思考-接受-记忆-输出] =&gt; 提问激发兴趣 <span>|</span>
                耗费了多少时间</p>
              <p class="indent"><span>3. 态度</span> </p>
              <p class="indent">对未知保持敬畏与渴求，保持好奇心，不懂就问-一点点积累（好学、自主向上）</p>
              <p class="indent">不怕吃苦，不怕困难，不怕失败，持之以恒地拼搏和追求，勤奋刻苦的进取精神（坚持、刻苦）</p>
              <p class="indent">高度负责的律己精神，严格自觉的守时精神，严谨务实的实干精神（脚踏实地、对自己负责-守时律己）</p>
              <p class="indent">独立思考，善于反思[出于系统又归于系统]，拥有敏捷高效的思维力，创造价值（条理清晰、整洁规范的笔记体系）</p>
              <p class="indent">[反思&探索积累] 决策力-安排得好不好，结果，效率，难点与可改进点-方法(提高效率-结合自身情况)</p>

              <p><b class="decoration">软实力培养</b></p>
              <p class="indent"><b title="至少1小时-毛笔钢笔粉笔字">书法练习</b>，<b
                  title="汉语粤语 英文阅读">语言学习</b>，思维模型练习，能力培养*(综合学习能力、记忆理解力、逻辑推理能力、计算能力、图别能力、空间想象能力、形象思维能力)</p>
              <p><b class="decoration">观世界观人文</b></p>
              <p class="indent">各种专业的书3本&名著 =&gt; 【四书】 大学 中庸 孟子 论语；【国学五经】 周易[易经+易传] 论语-儒 道德经-道 六祖坛经-佛 黄帝内经-落地 </p>
              <p class="indent">动植物进化(
                <b class="btn hotlink" onclick="toLink('https://tv.cctv.com/lm/dwsj/index.shtml')">动物世界 </b>，
                <b class="btn hotlink" onclick="toLink('https://tv.cctv.com/lm/ryzr/index.shtml')">人与自然 </b>)、历史长河( <b
                  class="btn hotlink"
                  onclick="toLink('https://search.cctv.com/search.php?qtext=%E7%99%BE%E5%AE%B6%E8%AE%B2%E5%9D%9B')">百家讲坛
                </b>)、自然科学、数学、高分电影(社会百态)、政治政策
              </p>
              <p><b class="decoration">培养兴趣</b></p>
              <p class="indent">阅读、摄影、美食、书法、绘画(纸 墙 木 沙 叶)、穿搭、美妆、养生、健身、唱歌、跳舞、演戏、收纳、种植、手工(针织
                编织(含竹编)、橡皮泥娃娃、领带绳子绑法、毛毡公仔、刺绣、衣服毛衣包包、刻章-橡皮章、剪纸、折纸+3D书、立体纸艺、模型建造)、解谜、拼图、数独、下棋、创作(小说、编程、音乐、电影、游戏)</p>
            </div>
          </div>
        </div>
      </div>

    </div>
    

    <!-- 签到 -->
    <div class="slideBox">
      <p class="btn odaka" title="点击切换柱形图/签到卡">
        <span class="daycheck-icon"><img src="./static/baobao.png" alt="猫猫图标" /></span>
        <span class="dakastatus">未</span>打卡
      </p>
      <span class="btn closebtn odaka">×</span>
      <div class="dayCheck">
        <div class="days">已经打卡<span class="dataDays">0</span>天，继续加油哦~</div>
        <div class="firstLine noselect"><input type="text" class="writeIn" placeholder="多项用*分隔（支持中英文 数字 -_）" /><span
            class="btn addItemBtn">添加</span></div>
        <div class="itemMenu noselect"><span>学习项目</span><span>学习天数</span> &nbsp;&nbsp;once a day</div>
        <ul class="dakaUl"></ul>
      </div>

      <div class="chart">
        <div class="days">哎呀，不小心搬砖<span class="dataDays">0</span>天了呢，更多看检查页...</div>
        <div class="canvas-wrapper">
          <canvas id="myCanvas" width="1136" height="520"></canvas>
        </div>
        <ul class="detailDaka"></ul>
      </div>
    </div>

    <!-- 中间框 -->
    <div class="morefunpart">
      <div class="back"></div>
      <div class="morepart-wrapper">
        <div class="morepart-content">
          <div class="btn closetipbtn">×</div>
          <!-- 0收集箱 -->
          <div class="section collectsection">
            <div class="title">收集箱 - 各种想做的事 <div class="easylink" title="外链"><img src="./static/baobao.png"
                  alt="猫猫图标" /></div>
            </div>

            <div class="collectouter">

              <div class="rightside noselect">
                <div class="cardecor" title="隐藏按钮-同样是实现分类">分类</div>
                <p style="text-align: center; margin-bottom: 20px;">引导步骤 <u class="toknewbtn" title="如何对事项进行分类？">?</u>
                </p>
                <div class="collectGuide" data-num="0">
                  <p>Q1：可行动吗？</p>
                  <p>no： <label data-num="4"><input type="radio" name="collect" />可能清单</label>，<label
                      data-num="5"><input type="radio" name="collect" />参考资料</label>，<label data-num="6"><input
                        type="radio" name="collect" />回收箱</label></p>
                  <p>Q2：能一步搞定吗？</p>
                  <p>no： <label data-num="3"><input type="radio" name="collect" />项目清单[next? plan?]</label></p>
                  <p>Q3：该我做吗？</p>
                  <p>no： <label data-num="2"><input type="radio" name="collect" />等待清单[makesure: what? deadline,
                      maybe?ring?]</label></p>
                  <p>Q4：特定时间？</p>
                  <p>no： <label data-num="0" class="active"><input type="radio" name="collect"
                        checked="true" />执行清单</label>
                  </p>
                  <p>yes：<label data-num="1"><input type="radio" name="collect" />日历清单[ring|calendar]</label></p>
                </div>
                <div class="controlfunc">
                  <span class="savecollectbtn" title="避免F5强制刷新或关闭网页/插件时遗失最新修改">保存</span>
                  <span class="classifybtn">分类</span>
                </div>
              </div>

              <div class="collectUl-wrapper">
                <p>(共<span class="collectPnum">0</span>项，选中<span class="collectPnum">0</span>项)</p>
                <ul class="collectUl"></ul>
                <div class="btn collectAddbtn">+</div>
              </div>
            </div>
          </div>
          <!-- 1标签管理 -->
          <div class="section tagsection">
            <div class="title">标签管理 - 查询下载 <div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" />
              </div>
            </div>


            <div class="tagfind noselect">
              <span class="tagtxtDelBtn" title="删除输入框内容">×</span>
              <input class="tagsearch" type="text" placeholder="Enter搜索 (起别名: XXX|新标签名) " />
              <span class="tagmakebtn" title="把当前搜索结果归纳为一个标签">设为标签</span>
              <div class="tagstatus">
                <u class="writebtn" onclick="ableToEdit(this,-5);" title="开启删除标签模式（目前仅支持两行标签显示）"></u>
                <span>#全部</span>
                <span>#今天</span>
                <span>#记忆</span>
                <span>本本</span>
                <span>收藏</span>
                <span title="需要在设置中开启">搜索记录</span>
              </div>
            </div>
            <div class="tagmenu noselect" data-menu="0">
              <div class="tagmenujumpline"><u title="查看签到情况">签</u><u title="查看特殊任务列表">特</u></div>
              <u class="tagmenudecor" title="点击查看-每日每周回顾指引"></u>
              <ul>
                <li class="active" data-menu="0">未完成</li>
                <li data-menu="1">已完成</li>
                <li data-menu="2">特殊任务</li>
                <li data-menu="3">回收箱</li>
              </ul>
              <div class="downloadnowbtn">编辑模式</div>
            </div>
            <div class="control">
              <u class="btn tagdownBtn" title="去掉前面的标志">去标</u>
              <u class="btn tagdownBtn" title="markdown格式">下载</u>
              <u class="btn tagdownBtn">取消</u>
            </div>
            <div class="tagCon-wrapper">
              <div class="tagContent">
                <div>(Undo<sup>-</sup>: 收集箱「集」 五个清单：执行「执」 日历「历」 等待「等」 项目「项」 可能「可」)</div>
                <ul class="undoUl"></ul>
                <div>(Done: 记忆 进程分析 打卡 完成[完] 小本本「本本」<sup>-</sup> )</div>
                <ul class="donedUl"></ul>
                <div>(Task: 刷新任务 定期任务 自定义链接「链接」 参考资料「参考」<sup>-</sup> 检查卡「检查」)</div>
                <ul class="taskUl"></ul>
                <div>(Delete: 回收箱[删]<sup>-</sup>) 【带有减号上标的项都是需要配合设置面板定期清理的项】</div>
                <ul class="deleteUl"></ul>
              </div>
              <div class="tagDownload">
                <div class="tagDownCon" contenteditable="true"></div>
              </div>
            </div>

          </div>
          <!-- 2设置 - 链接互用 -->
          <div class="section urlsection">
            <div class="title">设置 - 链接互用</div>
            <div class="referLink noselect"><span>方式1：将资料页自定义链接--添加至--参考资料</span><span class="restartbtn"
                data-txt="开启"></span>
            </div>
            <div class="referLink noselect">方式2：将资料页自定义链接--贴到--不同面板的标题旁的小猫:</div>
            <p class="tip noselect">【提示】 把链接的对应序号填入或输入http://|https://开头的网址 </p>
            <div class="linkuseCon">
              <ul class="partLinkUl">
                <li data-id="0"><span>检查卡:</span><input type="text" data-name="check" title="检查卡check小猫的链接输入" /></li>
                <li data-id="1"><span>完成卡:</span><input type="text" data-name="grow" title="完成卡grow小猫的链接输入" /></li>
                <li data-id="2"><span>小本本:</span><input type="text" data-name="book" title="小本本book小猫的链接输入" /></li>
                <li data-id="3"><span>启动页:</span><input type="text" data-name="moon" title="启动页moon小猫的链接输入" /></li>
                <li data-id="4"><span>分析模块:</span><input type="text" data-name="grow" title="分析模块grow小猫的链接输入" /></li>
                <li data-id="5"><span>完成模块:</span><input type="text" data-name="count" title="完成模块count小猫的链接输入" /></li>
                <li data-id="6"><span>记忆模块:</span><input type="text" data-name="learn" title="记忆模块learn小猫的链接输入" /></li>
                <li data-id="7"><span>特殊任务:</span><input type="text" data-name="check" title="特殊任务check小猫的链接输入" /></li>
                <li data-id="12"><span>收集箱:</span><input type="text" data-name="box" title="收集箱box小猫的链接输入" /></li>
                <li data-id="8"><span>标签管理:</span><input type="text" data-name="sign" title="标签管理sign小猫的链接输入" /></li>
                <li data-id="9"><span>问题记录:</span><input type="text" data-name="que" title="问题记录que小猫的链接输入" /></li>
                <li data-id="10"><span>项目管理:</span><input type="text" data-name="item" title="项目管理item小猫的链接输入" /></li>
                <li data-id="11"><span>日历记录:</span><input type="text" data-name="check" title="日历记录check小猫的链接输入" /></li>
              </ul>
              <ul class="urlUl noselect"></ul>
            </div>
            <div class="funbtns noselect"><span>清空已有设置</span><span>确定设置</span></div>
          </div>
          <!-- 3问题记录 -->
          <div class="section questionsection">
            <div class="title" title="只要思想不滑坡，办法总比问题多">问题记录及解决办法<div class="easylink" title="外链"><img
                  src="./static/baobao.png" alt="猫猫图标" /></div>
            </div>
            <div class="helptxt" style="margin-bottom: 8px;">
              <p class="txt">A.客观描述问题--&gt;[ 打开思路：你想怎么做，别人怎么做？]</p>
              <p class="txt">B.分析现实问题--&gt;[ 什么少了多了变了堵了？对应增删改除]</p>
              <p class="txt">C.判断与尝试(思路)--&gt;[ 观察 + 尝试的方法 =&gt; 结果 + 决定 ]</p>
              <p class="txt">D.小结：关键点？根据？更好办法？[ 回归目标，认真做充要条件 &gt; 持续做必要条件 ]</p>
            </div>

            <div class="quesnav noselect">
              <span class="quesmenuitem" title="避免F5强制刷新或关闭网页/插件时遗失最新修改">存</span>
              <span class="quesmenuitem" title="在文末添加问题模板">模</span>
              <span class="quesmenuitem" title="在文末添加日期">今</span>
              <span class="quesmenuitem" title="清空文本内容">清</span>
              <span class="quesmenuitem" title="回到顶部">&and;</span>
            </div>
            <div class="quesCon-wrapper">
              <div class="quesCon" contenteditable="true" spellcheck="false"></div>
            </div>
          </div>
          <!-- 4项目内容 -->
          <div class="section itemsection">
            <div class="title">项目管理<div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div> -
              <b class="itemNameTxt">帮助&介绍</b></div>
            <div class="item-nav">
              <p class="p-title">项目编号：
                <select class="itemselect" name="itemSelect" title="项目编号选项"></select>
                <span class="itemnumBtn btnitem unactive" title="根据编号更换项目数据">切换项目</span>
                <span class="itemnumBtn btnitem" title="项目数据变动了，手动刷新数据">刷新</span>
                <span class="itemnumBtn btnitem unactive" title="归档后数据不再同步，且在项目清单中移出">归档</span>
                <span class="itemnumBtn btnitem" title="在标签管理中获取该项目对应的md数据">导出</span>
              </p>
              <div class="describeOuter">
                <p class="remarkstxt" contenteditable="true" spellcheck="false"> ( 项目相关内容：时间段 备注 注意事项等 ) </p>
              </div>
              <p class="addsignP p-title">新建小目标，并采用事项标志：<input class="itemsign" type="text" placeholder="阶段名|标志" />
                <span class="itemsignBtn btnitem" title="采集清单项中含有该标志开头的项形成内容">添加</span>
              </p>
              <p class="p-title">已有标志：
                <b class="signTxt"><span>模板标志</span></b>
                <span class="itemsignDelBtn btnitem" title="删除某个阶段与标志--不可恢复">删除标志</span>
                <span class="itemsmallBtn btnitem" title="折叠各个阶段内容">折叠</span>
                <span class="itemDelBtn btnitem" title="删除下面所有的关联内容">重置</span>
              </p>
            </div>

            <div class="itemAllPeriod">
              <div class="itemPeriod" data-sign="模板标志">
                <div class="itemStatus" data-show="1" onclick="showWrapper(this)">
                  <div class="itemprogressback"><mark></mark></div><span>&gt;</span>
                  <div class="periodName">阶段名(@模板标志)</div>
                  <div class="periodCount">计划(<b>5</b>) 进行(<b>4</b>) 完成(<b>6</b>)</div>
                </div>
                <div class="itemCon-wrapper">
                  <div>
                    <p class="p-title">计划中-收集箱：<span class="btn itemAddBtn"
                        onclick="writeLayer('itemadd', '模板标志')">+</span></p>
                    <ul class="itemplanUl">
                      <li>[项范围] 项目里事项的范围包括：收集箱、执行清单、日历清单、等待清单和完成清单</li>
                      <li>[项格式] 表示项目项的关键是标志，在输入事项时在【句首】用格式“@标志 ”(后有空格)书写，标志仅支持 中文|小写字母|数字|下划线|短横线</li>
                      <li>句首用@标志 时添加多项：收集箱是默认每项都添加该标志，其他清单想要每项都添加标志可点击“自动处理”按钮来处理</li>
                      <li>[关联项] 要想把含有某标志的内容纳入项目，需要在当前面板写好“阶段名|标志”并添加</li>
                      <li>[项同步] 项目添加阶段及标志后，即一直同步含标志的各清单项的状态（归档之后就不再同步）</li>
                    </ul>
                  </div>
                  <div>
                    <p class="p-title">进行中-清单项(可一步搞定的)：</p>
                    <ul class="detail itemtodoUl">
                      <li><span class="cbox"></span><b class="item">点击阶段名可收起或展开具体事项</b></li>
                      <li><span class="cbox"></span><b class="item">[阶段改名] 直接重新添加“新阶段名|同个标志”就可以了</b></li>
                      <li><span class="cbox"></span><b class="item">[查看标志] ① 阶段名中括号内容；②
                          已有标志展示的排列和下面阶段内容的排列是一一对应的；③ 点击+号进入书写框得到@标志</b></li>
                      <li><span class="cbox"></span><b class="item">[删除标志] 点击删除标志，再需输入要删除的标志名称</b></li>
                    </ul>
                    <ul class="detail itemdoneUl">
                      <li><span class="cbox"></span><b
                          class="item">项目编号和项目里不同阶段的标志都用@指定，但不要混淆。@编号(放句末)写在项目清单里，@标志(放句首)写在执行/日历/等待/收集箱里，它们与正文内容之间都用空格隔开</b>
                      </li>
                      <li><span class="cbox"></span><b class="item">项目的编号具有唯一性，在输入项目清单项时，在【句末】用“
                          @编号”(前面有空格)指定，编号仅支持
                          小写字母|数字|下划线|短横线</b></li>
                      <li><span class="cbox"></span><b
                          class="item">项目项成功添加编号后，会在前面增加书签图标，可点击进入对应项目。如果没有标识，那就是添加格式不对了</b>
                      </li>
                      <li><span class="cbox"></span><b
                          class="item">若某项目项修改了编号(或该项目项已删除)，那么原编号的数据虽作废但仍然存在，此时可在设置里删除“项目失效数据”</b></li>
                      <li><span class="cbox"></span><b
                          class="item">若某项目项里关联的内容已经完成，那么该项目可以点击按钮“归档”，日后该编号的事项将不再同步更新（但备注信息还是可改的）</b></li>
                      <li><span class="cbox"></span><b class="item">注意：项目的编号和里面的各个标志本身都不含有@，只是在输入事项时需要@标识【在标签管理里可通过
                          @@编号 获取md格式内容】</b></li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>


          </div>

          <!-- 5日历签 -->
          <div class="section calendarsection">
            <div class="title">日历/记录签<div class="easylink" title="外链"><img src="./static/baobao.png" alt="猫猫图标" /></div>
            </div>

            <div class="calendartype noselect">
              <div class="calendarTypePart">
                <em class="cbtn active" data-type="hobbit">习惯</em>
                <em class="cbtn" data-type="count">收入</em>
                <em class="cbtn" data-type="cost">支出</em>
                <em class="cbtn" data-type="special">特殊</em>
              </div>
              <span class="ccbtn backToTodayBtn" title="回到今天">今</span>
              <span class="ccbtn yearBtn" title="查看总报">总</span>
              <p class="calendarCountTxt" title="月份（天数，总工时&总收入，当日收入）"></p>
              <p class="calendarCountTxt" title="月份（天数，生活总支出，当日支出）"></p>
            </div>
            <div class="calendar-wrapper">
              <div class="calendarController noselect">
                <div class="calendar-title">
                  <span class="ccbtn chooseMonthBtn" title="上一个月">&lt;</span>
                  <p class="dateChange" title="点击可输入日历日期（当输入为空则回到本月）">
                    <span class="dateTxt">2022</span>-<span class="dateTxt">03</span>
                    <input class="getCalendarDateIn" type="text" title="输入框失去焦点后，确定日期" />
                  </p>
                  <span class="ccbtn chooseMonthBtn" title="下一个月">&gt;</span>
                </div>
                <p class="calendar-week"><i>日</i><i>一</i><i>二</i><i>三</i><i>四</i><i>五</i><i>六</i></p>
                <ul class="calendarUl"></ul>
              </div>
              <div class="calendar-content">
                <div class="havepast">
                  <p>今年已过<b class="pastDay">多少天</b>，本月已过<b class="pastDay">多少天</b>。</p>
                </div>
                <div class="calendar-inputPart noselect">
                  <div class="calendar-sign" title="点击标签可快速添加">选标签：<ins class="calendarSignPartMK"></ins></div>
                  <p class="calendar-input">
                    <input class="writeCalendarIn" type="text" placeholder="标签+触发场景 日期" title="日期写前写后都可以，若不写则默认为今天" />
                    <button class="cbtn writeCalendarBtn" title="保存输入">√</button>
                    <button class="calendarClearBtn" title="清空输入" type="button">×</button>
                  </p>

                </div>
                <p class="calendarCountTxt"></p>
                <p class="willOverdueTxt"></p>
                <div class="calendarmenu-outer noselect">
                  <span class="cbtn yearBtn">总报</span>
                  <span class="cbtn sortCalendarBtn">顺序</span>
                  <span class="cbtn helpCalendarBtn">贴士</span>
                  <span class="cbtn signInBtn">签到</span>
                  <span class="cbtn delCalendarBtn">删除 ▼</span>
                  <div class="moreDelPart">
                    <span class="cbtn delCalendarbtn" data-name="hobbitDel-习惯标签">删除该月某个习惯的数据</span>
                    <span class="cbtn delCalendarbtn" data-name="monthDel">删除该月该类型的数据</span>
                    <span class="cbtn delCalendarbtn" data-name="termDel">删除该月的过期物品数据</span>
                    <span class="cbtn delCalendarbtn" data-name="typeDel">删除该类型的全部数据</span>
                    <span class="cbtn delCalendarbtn" data-name="periodDelAll">删除全部经期记录</span>
                    <span class="cbtn delCalendarbtn" data-name="plantDel">删除全部植物记录</span>
                  </div>
                </div>
                <ul class="calendarDetailUl"></ul>
              </div>
            </div>
          </div>

          <!-- 6简版页 - 内容凸显 -->
          <div class="section findsection">
            <div class="title">查找结果</div>
            <span class="sureReplaceBtn">确定转换</span>
            <span class="sureReplaceBtn statusReBtn">匹配结果</span>
            <p class="findtip">总字数<span class="findcount"></span>，共<span class="findcount"></span>行，查找到<span
                class="findcount"></span>处</p>
            <div class="find-wrapper">
              <ol class="ordernumOl"></ol>
              <div class="findcontent"></div>
            </div>
          </div>

          <!-- 7总报 -->
          <div class="section yearsection">
            <div class="title"><span class="backtoCalendarBtn noselect">←</span>总报</div>
            <p class="calendartype noselect">
              <span class="yearTypePart">
                <em class="cbtn" data-type="hobbit">习惯</em>
                <em class="cbtn" data-type="count">收入</em>
                <em class="cbtn" data-type="cost">支出</em>
                <em class="cbtn" data-type="special">特殊</em>
              </span>
              <span></span>
            </p>
            <div class="yearsection-wrapper" data-index="0">
              <div class="yearSummary">
                <p class="summaryTxt"></p>
                <p class="summaryTxt"></p>
                <p class="summaryTxt"></p>
              </div>
              <div class="yearCondition"></div>
              <div class="yearCondition"></div>
              <div class="yearCondition"></div>
              <div class="yearCondition"></div>

            </div>

          </div>
        </div>

        <div class="morepart-notebox">
          <input type="text" class="morewritebox" placeholder="( 添加到随记 Enter )" />
          <div class="focusfoback"></div>
          <div class="cleartxtbtn">×</div>
        </div>
      </div>

    </div>

    <!-- 设置面板 -->
    <div class="setting">
      <div class="settingback" title="点击关闭设置面板">
        <div class="btn closetipbtn">×</div>
      </div>
      <div class="settingpart">
        <div class="piece" style="margin-top: 20px;">
          <div class="title noselect">简单说明<strong class="link"
              onclick="toLink('https://www.yuque.com/nibaobao-youho/pqbrew/doit')">（文章） </strong>
          </div>
          <b>快捷键(Alt+)：简记 Alt + ASDCWBTQIRZ|0123(书写框操作键) </b>
          <b style="text-indent: 2em; font-size: .9em;">主页A，检查页C，书写框W，收集箱B，问题Q，项目I，日历签R，关闭窗口层Z</b>
          <b style="text-indent: 2em; font-size: .9em;">添加项/加入随记Enter，添至执行清单D，站外搜索S，站内搜索T(打开标签管理并搜索[主页输入框或书写框的内容])</b>
          <b>数据保存(简版页|标签管理)：①备份清单数据-可导入 ②处理数据</b>
        </div>

        <div class="piece noselect">
          <div class="title">个性/搜索选择</div>
          <div class="thirdCon">
            <div class="themeline">主题模式：
              <label><input type="radio" name="themeMode" checked="checked" class="themechoose"
                  value="明亮模式" /><span>明亮</span></label>
              <label><input type="radio" name="themeMode" class="themechoose" value="灰度模式" /><span>灰度</span></label>
              <label><input type="radio" name="themeMode" class="themechoose" value="暗黑模式" /><span>暗黑</span></label>
            </div>

            <div class="searchModeline">搜索范围：
              <label><input type="radio" name="searchMode" checked="checked" class="searchMode"
                  value="百度" /><span>百度</span></label>
              <label title="高效视频书网站，可搜索很多有用的技巧和方法"><input type="radio" name="searchMode" class="searchMode"
                  value="Topbook" /><span>Topbook(TB)</span></label>
              <label title="各类资源综合网"><input type="radio" name="searchMode" class="searchMode"
                  value="B站" /><span>B站</span></label>
              <label title="热心网友回答"><input type="radio" name="searchMode" class="searchMode"
                  value="知乎" /><span>知乎</span></label>
              <label title="很全的代码问题集中区"><input type="radio" name="searchMode" class="searchMode"
                  value="CSDN" /><span>CSDN</span></label>
              <label><input type="radio" name="searchMode" class="searchMode" value="简书" /><span>简书</span></label>
              <label title="代码方面社区"><input type="radio" name="searchMode" class="searchMode"
                  value="掘金" /><span>掘金</span></label>
              <label title="代码方面社区"><input type="radio" name="searchMode" class="searchMode"
                  value="思否" /><span>思否</span></label>
              <label title="微信公众号文搜索"><input type="radio" name="searchMode" class="searchMode"
                  value="微信搜狗" /><span>微信搜狗(WX)</span></label>
              <label title="各种文档库"><input type="radio" name="searchMode" class="searchMode"
                  value="语雀" /><span>语雀</span></label><i class="result"></i>
            </div>

            <div>主页&总结面板 - 小菜单保留“开启/关闭单项功能操作”按钮
              <span class="controlchoose restartbtn" data-txt="开启"></span>
            </div>

            <div>启动页 - 每次生成数据后都清空表单
              <span class="deletechoose restartbtn" data-txt="开启"></span>
            </div>

            <div class="isPlayAudio" style="display: none;">启动页 - 倒计时结束后播放音效
              <span class="audiochoose restartbtn" data-txt="开启"></span>
            </div>

            <div>简版页 - 简化处理数据（完成清单+小本本+参考资料）
              <span class="outputchoose restartbtn" data-txt="开启"></span>
            </div>

            <div>检查页 - 完成清单搜索的结果显示所有日期
              <span class="unshowNonechoose restartbtn" data-txt="开启"></span>
            </div>

            <div class="isSaveLocal">每次utools插件进入后台时数据自动保存 ( 强烈建议 )
              <p class="savePathTxt">【本地保存地址】C:\Users\用户名\AppData\Roaming\uTools\database\Doit.json</p>
              <mark class="jumpToPath">跳</mark>
              <span class="savelocalchoose restartbtn active" data-txt="关闭"></span>
            </div>
            <div class="issearchRecord">【搜索】记录每次外搜的内容（可以在标签管理处查看）
              <span class="recordchoose restartbtn" data-txt="开启"></span>
            </div>
            <div class="noUnderline">日历签 - 每月的具体数据按顺序排列
              <span class="calendarsortchoose restartbtn" data-txt="开启"></span>
            </div>


          </div>

        </div>

        <div class="piece noselect">
          <div class="title">数据自定义</div>
          <div class="firstCon">
            <!-- 已轮到了data-btn=14了，该范围内结果提醒 1 ~ 5，后面的删除还有个6-->
            <div class="tomatoPart">
              <p>番茄计时“工作+休息”：
                <input type="text" placeholder="25+5" title="输入用+间隔的两个数字，分别设定工作与休息的分钟数" />
                <span data-btn="14">确定</span><i class="result"></i>
              </p>
            </div>
            <div>
              <p title="注意！该修改会中断进行中的计时">启动页-休息时间：<input type="number" min="1" placeholder="现值：300(秒)" /><span
                  data-btn="7">确定</span><i class="result"></i></p>
              <p style="margin: 4px 6px;" title="修改为空值即恢复默认内容">做事类型自定义：<u class="odotype ellipsis">……默认项……</u><span data-btn="8">修改</span>
              </p>
              <p style="margin: 4px 6px;" title="修改为空值即恢复默认内容">可用方法自定义：<u class="obetterway ellipsis">……默认项……</u><span data-btn="9">修改</span></p>
            </div>
            <div><b>检查页头部-判定设置：<i class="result"></i></b>
              <label>任务数量显示的阈值
                <input type="number" min="1" max="100" placeholder="现值：10" />
                <span data-btn="0">确定</span>
              </label>
              <label title="若每日完成度不满足该值将显示蓝色或紫色，可理解为完成度预期值">任务完成度目标值(%)<input type="number" min="1" max="100"
                  placeholder="现值：30(即30%)" /><span data-btn="1">确定</span></label>
            </div>
            <div><b>进程分析模块-完成度等级判定：<i class="result"></i></b>
              <label title="A级别的值应比B级别的值大">A级别判定值<input type="number" placeholder="现值：80" min="1" max="100" /><span
                  data-btn="2">确定</span></label>
              <label title="若B级别的值比A级别的值还大，那么B级别的值判定无效">B级别判定值<input type="number" placeholder="现值：65" min="1"
                  max="100" /><span data-btn="3">确定</span></label>
            </div>
            <div>
              <b>特殊任务设置：</b>
              <p style="text-align: center;margin-top: 8px;">
                <span class="refreshbtn" data-btn="4" data-txt="日刷任务">日刷任务</span>
                <span class="refreshbtn" data-btn="5" data-txt="周刷任务">周刷任务</span>
                <span class="refreshbtn" data-btn="6" data-txt="月刷任务">月刷任务</span>
                <span class="regularbtn" data-btn="10" data-txt="定期任务">定期任务</span>
                <span class="jumpToRefresh" data-btn="999" title="查看所有刷新/定期任务状态">看</span>
                <span class="countdownbtn" data-btn="13" data-txt="日期倒计时">日期倒计时</span>
              </p>
              <p style="margin: 6px 0;">定期任务提前提醒：<input type="number" min="0" placeholder="现值：3(天)" /><span
                  data-btn="11">确定</span><i class="result"></i></p>
            </div>

            <div class="noUnderline">
              <p>资料页自定义链接映射到其他地方、各模块卡片贴链接 <span data-btn="12">设置</span></p>
            </div>

          </div>
        </div>
        <div class="piece noselect">
          <div class="title">各项数据删除</div>
          <div class="secondCon">
            <div>
              <label><input type="checkbox" class="dataclear" value="打卡" /><span class="cbox"></span>打卡</label>
              <label><input type="checkbox" class="dataclear" value="分析" /><span class="cbox"></span>进程分析</label>
              <label><input type="checkbox" class="dataclear" value="完成" /><span class="cbox"></span>完成清单</label>
              <label><input type="checkbox" class="dataclear" value="记忆" /><span class="cbox"></span>记忆模块</label>
              <label title="清空执行|日历|等待三个清单和回收箱"><input type="checkbox" class="dataclear" value="清单" /><span
                  class="cbox"></span>清单<sup>-</sup></label>
              <label><input type="checkbox" class="dataclear" value="检查卡" /><span class="cbox"></span>检查卡</label>
              <label><input type="checkbox" class="dataclear" value="小本本" /><span class="cbox"></span>小本本</label>
              <label title="全部刷新任务，包括已完成的任务记录"><input type="checkbox" class="dataclear" value="刷新任务" /><span
                  class="cbox"></span>刷新任务</label>
              <label title="当日已完成的刷新任务记录"><input type="checkbox" class="dataclear" value="当日已完成的刷新任务记录" /><span
                  class="cbox"></span>刷新任务的完成记录</label>
              <label title="全部定期任务"><input type="checkbox" class="dataclear" value="定期任务" /><span
                  class="cbox"></span>定期任务</label>
              <label title="参考资料"><input type="checkbox" class="dataclear" value="参考资料" /><span
                  class="cbox"></span>参考资料</label>
              <label title="收集箱"><input type="checkbox" class="dataclear" value="收集箱" /><span
                  class="cbox"></span>收集箱</label>
              <label title="回收箱"><input type="checkbox" class="dataclear" value="回收箱" /><span
                  class="cbox"></span>回收箱</label>
              <label title="所有数据都会删掉"><input type="checkbox" class="dataclear" value="全部" /><span
                  class="cbox"></span>全部</label>
              <label title="自定义数据"><input type="checkbox" class="dataclear" value="自定义数据" /><span
                  class="cbox"></span>自定义数据</label>
              <label title="搜索记录"><input type="checkbox" class="dataclear" value="搜索记录" /><span
                  class="cbox"></span>搜索记录</label>
              <label title="项目失效数据"><input type="checkbox" class="dataclear" value="项目失效数据" /><span
                  class="cbox"></span>项目失效数据</label>
              <label title="所有项目数据"><input type="checkbox" class="dataclear" value="所有项目数据" /><span
                  class="cbox"></span>所有项目数据</label>
              <label title="所有日历数据"><input type="checkbox" class="dataclear" value="所有日历数据" /><span
                  class="cbox"></span>所有日历数据</label>
              <span class="dataclear">清空所选</span> <i class="result"></i>
            </div>
          </div>
        </div>


      </div>
    </div>


    <script>
      let today = '';      // 2021/08/08
      let todayAdd = '';   // 2021-08-08
      let nextYM = '';     // 2021-09
      let s_doitData = ''; // 数据
      let SAVEPATH = '';   // 数据存放路径
      let isUtoolsOut = false;   // utools处于删除全部的状态
      let isOpenSetting = false; //设置处于打开的状态
      let noRefreshNote = true;  // 刷新任务不存在的状态
      let percent = '0%';  // 由当日 完成任务数/总任务数 的比值
      let n_daytask = 0; // 当日完成的任务数量
      let n_allday = 0;  // 当前所有的任务量（包括完成与未完成-但只包含3个列表）
      let n_analyseDiff = 0;  // 分析数据的难度选择 ABC无
      let n_newpartshow = -1; // 最新的页面选择
      let n_oldpartshow = -1; // 旧的页面选择
      let n_randomshow = 0;   // 检查页头部随机文本选择
      let n_searchChoose = 0; // 当前搜索引擎序号
      let n_topsize = 240;    // 移动端时滚动到顶部的距离值，电脑 240 移动端 354
      let dcalendarType = 'hobbit'; // 日历签-当前类型
      let dyearType = 'hobbit'; // 日历签-总报的当前类型
      let dsortType = '0'; // 日历签-排序情况（0为逆序 1为顺序）
      if (document.body.offsetWidth < 420) {
        n_topsize = 328;
      }
      var regexDate = /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/;
      var regexDateFront = /^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])/;
      var regexOnlyDate = /^([0-9]{4})\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/;
      var regexDateOnly = /^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/;

      let {
        year,
        month,
        date,
        week
      } = getTime();
      // var odate = new Date(); //这时间获取的是本地的本时区
      let now = new Date(year, month - 1, date).getTime(); // 时间戳 一长串数值，如：1631232000000

      const txtData = { // 负责HTML的文本修改
        finishNum: 0, // 任务总数
        countDown: '', // 倒计时内容
        todayDaka: '', // 今日打卡内容
        itemHTML: '', // 项目管理的部分HTML
        searchCondition: '', // 搜索设置情况
        regularNum: 0,
        willOverdueTxt: '', // 下个月的过期物提醒
        specialTotalStr: '' // 特殊总报内容
      };

      const tmpListenTime = {
        specialFresh: 0, // Fresh上次同步信息的时间戳
        specialChange: 1 // Change内部信息修改的时间戳
      };
      const itemO = {
        signO: {}, // 当前项目编号对应的已有的标志 

      };
      // 规定：内存数据对应的变量 以 Arr Obj Str 结尾
      let dataObj = localGet('dataObj', 'object')? localGet('dataObj', 'object'):{};
      let refreshArr = []; // 日周月刷新任务(refreshArr[3]包括开启否) => refreshlist
      let delRefreshArr = []; // 删除数据-[{号-删除串^},{'号'-删除串^},{月号-删除串^}] => delRefresh
      let refreshO = {}; // 处理数据-012对应真实的刷新任务
      let tmpRefreshA = []; // 处理数据-refreshO添加前缀处理后形成

      let regularObj = {}; // 定期：日期对应提醒项  日期：[提前提醒日，数据] => regularObj
      let noticeDateStr = ''; // 提醒日期的组合 ^  => noticeDates

      let tagArr = []; // 标签列表 => dataObj['taglist']
      let linkArr = []; // 热链接的临时列表 =>  dataObj['hotlinkArr']
      let badmoonArr = []; // 记录心情不好的日期  => dataObj['badmoon']
      let filedArr = []; // 归档项目编号数组 =>  dataObj['filedlist']
      let linkConnectObj = {}; // 链接互用设置数据  => dataObj['linkconnectObj']
      let analyseArr = []; // 表单的分析模块数据  => analyseData
      let existItemArr = ['模板']; // 已有的项目编号，默认模板abc  => 生成型 existItem 
      let recordSearchStr = ''; // 数据-搜索记录 => searchData
      let quesConStr = ''; // 处理数据-对应处理后的问题记录 => questxt(<=它含标签)
      let itemObj = {}; // 项目总数据对象   =>  itemObj

      let finishObj = {}; // 任务对象，日期-[完成率，总数]
      let expirelist = []; // 逾期数组

      // 用户统计数据
      let userDefined = {
        'author': 0,
        'levela': 80,
        'levelb': 65,
        'tasknum': 10,
        'difficult': 0.3,
        'themeMode': 0,
        'searchWeb': 0,
        'deleteChose': 0,
        'audioChose': 0,
        'unshowNoneChose': 0,
        'recordSearchChose': 0,
        'calendarSortChose': 0,
        'controlChose': 0,
        'saveLocalChose': 1,
        'outputChose': 'all',
        'restTime': 300,
        'doType': '整理*社交*生活*尝试*学习*项目*教学*反三',
        'betterWay': '实践试错*提问搜索*视频-模块化*实战模仿*导图-联想分类*讨论*故事',
        'taskMentionTime': 3,
        'tolinkrefer': 0
      }; //可用户自定义的数据;
      const {log} = console;
      const growData = {
        txtReplace: '',
        doType: '整理*社交*生活*尝试*学习*项目*教学*反三',
        betterWay: '实践试错*提问搜索*视频-模块化*实战模仿*导图-联想分类*讨论*故事',
        defaultTask: '今日事今日毕，每天进步一点点',
        tomatoTime: '25+5',
        priority: '不重要不紧急',
        searchList: [
          'https://www.baidu.com/s?ie=UTF-8&wd=',
          'https://topbook.cc/search/article?keywords=',
          'https://search.bilibili.com/all?keyword=',
          'https://www.zhihu.com/search?q=',
          'https://so.csdn.net/so/search?q=',
          'https://www.jianshu.com/search?q=',
          'https://juejin.cn/search?query=',
          'https://segmentfault.com/search?q=',
          'https://weixin.sogou.com/weixin?type=2&query=',
          'https://www.yuque.com/search?q='
        ],
        searchNameList: ['百度', 'Topbook(TB)', 'B站', '知乎', 'CSDN', '简书', '掘金', '思否', '微信搜狗(WX)', '语雀'],
        searchName: ['百度', 'TB', 'B站', '知乎', 'CSDN', '简书', '掘金', '思否', 'WX', '语雀'],

        localStr: ['collectSortBox', 'dolist', 'noticeDates', 'questxt', 'searchData', 'analyseData'],
        localObj: ['itemObj', 'regularObj', 'memoryObj', 'userDefined', 'checkDaka', 'dakadateObj','calendar', 'dataObj'],
        localList: ['collect', 'summarylist', 'checklist', 'finishlist', 'delRefresh',
          'finishdate', 'refreshlist', 'dakadate', 'oldfinishItem', 'lastDelFinishDate'
        ],
        defaultAnalyseStr: '2021-02-28 内容关于或问题：“等级C模板”<br />总任务是：天天开心，身体健康<br />优先解决：……<br />【难度4颗星】 [计划15分钟，实际用时30分钟]，完成度：50%<br />困难或障碍出自：…… <br />打算：……^2021-02-28 内容关于或问题：“等级A模板”<br />总任务是：天天开心，身体健康<br />优先解决：…… <br />【难度2颗星】 [计划8分钟，实际用时10分钟]，完成度：80%<br />困难或障碍出自：…… <br />打算：……^2021-02-27 内容关于或问题：“等级B模板”<br />总任务是：天天开心，身体健康<br />优先解决：…… <br />【难度3颗星】 [计划21分钟，实际用时30分钟]，完成度：70%<br />困难或障碍出自：…… <br />打算：……^2021-02-27 内容关于或问题：“默认空版”<br />总任务是：今日事今日毕，每天进步一点点(可自定义默认的)<br />优先解决：……<br />【难度1颗星】 [计划……分钟，实际用时……分钟]，完成度：……<br />困难或障碍出自：…… <br />打算：……'
      };

      const tipO = { // 内部提示
        default: '随记随感-解决问题时遇到的难点/关键点/技巧等方面的想法（用关键词写）',
        link: '<b class="link" onclick = toLink("【写网址】")>【写链接标题文字】</b>',
        addDo: '【执行清单添加】',
        addDay: '【日历清单添加】( Ps:加日期可添加当日 或 根据“明天”“后天”“?天后”字眼自动添加，其中?为数字 )',
        addWait: '【等待清单添加】',
        addItem: '【项目清单添加】末尾添加“ @编号”（支持小写字母|数字|下划线|短横线）',
        addMay: '【可能清单添加】',
        addCountdown: '( 日期倒计时：呈现在右上角日期前面，内容如“庆典 2022-01-01” )',
        addRegular: '( 每次添加一项，例如“元旦要聚会 2022-01-01” )',
        edit: '( 进入修改模式……可添加字母或单词做对应标记，如g-表修改 )',
        editRegular: '( 正在修改定期任务【此操作先删后增】 )',
        refresh: '( 已显示所有日/周/月刷新任务数据，可覆盖修改，没内容是无法开启任务的 )',
        successAdd: '( 新项添加成功 )',
        successDo: '( 事项已成功加入执行清单 )',
        successCollect: '( 事项已成功加入收集箱 )',
        successRefer: '( 参考资料新项提交成功 )',
        successCheck: '( 检查卡新项提交成功 )',
        successNote: '( 笔记写入小本本了，可点击总结按钮查看 )',
        successRegular: '( 定期任务设置成功，帮助页的特殊任务列表已刷新 )',
        successCountdown: '( 日期倒计时设置成功，已在右上角显示 )',
        successTask: '( 任务内容设置成功，可点击【开启任务】按钮开启任务 )',
        successTaskFresh: '( 任务内容设置成功，列表已刷新 )',
        successUrl: '( 添加成功 )',
        errorUrl: '( 数据错误，添加失败 )',
        character: '( 请输入正确内容，注意不包含$^&字符 )',
        warnDay: '( 该日期已过期了，请修改日期 )',
        warnDate: '( 该日期不存在，请核查 )',
        warnDayLink: '( 注意：日历清单日期和链接同时使用时剩余天数将不进行提示 )',
        warnLink: '( 上面内容不规范，添加失败，请删除链接外的<或>。【确保：每项的链接位置同时占据头尾或只在中间】 )',
        noLink: '( 目前该项并不支持链接输入也禁止<或>的出现 )',
        warnSame: '( 警告：不要输入两项包含关系的任务，请修改文本再确定任务 )',
        warnTask: '( 提示：没内容是无法开启任务的，请先确定任务内容后再开启 )',
        warnStartTxt: '( 修改失败，只支持中英文数字和-_*符号输入 )',
        errorObj: '( 选择对象出错了 )',
        errorDate: '( 日期判断失误，需要把2022-01-01格式的日期写在末尾 )',
        wrongurl: '( 内容不规范，请删除链接外的<或>，输入正确的网址【确保：每项的链接位置同时占据头尾或只在中间】 )',
        helpDate: '( 提示：日期需放在文本的末尾，这样日期排序或定期任务才生效哦 )',
        helpMemory: '( 注意: 记忆项文本中[]括起来的部分可在主动回忆模式下隐藏哦 )',
        collect: ['【添加】①点击右侧的加号添加；②在主界面中选中收集类目再添加；③在简版页显示框导入数据', '【编辑】和主编辑页不同，这里单击即可编辑（关闭该小窗口时会自动保存）',
          '【删除】虽然不计入进度数目统计中，但删除会移到回收箱', '【处理】点击每项左侧的圆圈选中单项或多项，再配合右边选择的清单，点击分类按钮快速分配入对应清单'
        ]
      };
      const tellO = { // 弹框提示 tellyouTip（注意：一些带有局部变量的是不计入的）
        notUpdate: '【未更新】该部分功能正在规划中……',
        addSign: '【错误】需要按照“阶段名|标志”格式输入哦，中间的 | 不可省',
        delSign: '【操作】请输入想要删除的标志（仅一个）',
        warnSign: '【错误】当前输入的标志不符合规范哦，标志仅支持 中文|小写字母|数字|下划线|短横线',
        warnReset: '【操作】确定清空下面关联的所有内容？\n【警告】即使下次关联相同的标志，也只能获取当下的完成项，获取不了已经删掉的含标志的完成项',
        helpReset: '当前编号不存在，这是模板，不可进行此操作。\n【注意】重置功能是删除下面关联所有的内容，请谨慎使用。',
        helpSign: '当前编号不存在，这是模板，不可添加标志。\n建议一：切换项目\n建议二：新建项目(在项目清单中添加一项尾部含@编号的事项)\n【阶段重命名】再添加一次含相同标志的内容即可',
        helpDelSign: '当前编号不存在，这是模板，不可删除标志。\n建议一：切换项目\n建议二：新建项目(在项目清单中添加一项尾部含@编号的事项)',
        helpFresh: '【注意】项目管理是惰性同步，“切换项目”按钮是不会自动同步数据的，需要点击“刷新”。\n（而直接点击项目项左边的书签图标进入的则会自动同步）',
        helpHobbit: '【注意】同一天不可以添加重复的标签，保存失败！',

        userOk: '【成功】用户数据获取成功！',
        userWarn: '【错误】数据文件非json格式，无法同步！',
        userHelp: '【提示】需要先选择json数据文件',
        warnTxtFile: '【错误】请选择后缀为txt的备份数据文件！',
        userOutput: '【操作须知】：本插件本身不保存或收集任何用户数据，数据存在用户的浏览器缓存里(不清理则不会影响使用)，如需同步到其他平台，可下载本同步文件后在新平台上导入。\n\n务必保管好自己的用户数据，以防泄漏（确认下载的话请输入“我了解”三个字）',
        fileInput: '【覆盖操作】确定用当前txt文件的有效内容覆盖现有的数据吗？【确定的话输入doit】\n\n(非此处下载的备份文件导入时除了注意格式还需注意：文件非UTF-8编码的请另存一份UTF-8编码的txt再导入，否则内容会出现乱码)',
        dataInput: '【导入操作】确定用下面显示框的数据进行导入吗？该操作会用有效数据覆盖现有数据。【确定的话输入doit】',
        helpInput: '【提示】需要先选择txt备份文件 或 在“数据显示区”按格式写入内容后再导入',
        inOutputTip: '注意区分：\n\n1.同步文件json是用户所有数据-注意隐私保密（加载时基于存在才替换的原理）\n\n2.备份文件txt是清单数据（还可在“数据显示区”导入数据）\n间隔符：收集箱(&) 和(^)清单(~ $) 和(^) 检查卡(&)\n\n3.处理文件md是辅助内容。',

        delQues: '【清空操作】确定清空所有吗？(清空后将无法恢复)',
        delProgress: '【清空操作】确定清空所有进程内容吗？(清空后将无法恢复)',
        delFinish: '【清空操作】确定清空所有完成项内容吗？(清空后将无法恢复，统筹数据里的完成数将重新计算)',
        delMemory: '【清空操作】确定清空所有记忆内容吗？(清空后将无法恢复)',
        delSomelist: '【清空操作】确定清空常用清单内容吗？(内容包括“执行清单+日历清单+等待清单+回收站”，清空后将无法恢复)',
        delTextarea: '【清空操作】确定清空所有文本吗？(清空后将无法恢复)',
        delSetting: '【清空操作】确定清空所有选择的项吗？(清空后将无法恢复)',
        delLinkConnect: '【清空操作】确定清空已有的链接互用关联吗？(清空后需重新设置)',
        delTimeOutItem: '【清空操作】确定清空所有逾期项[距离记录日超过30天的内容]吗？(清空后将无法恢复)',

        uCard: `【桌面计时自定义】 “时间 | 内容” \n\n 时间值为0或空 => 累加计时-直到1小时(期间都可切换为番茄计时) \n 时间值非0 => 先倒计时后累加计时\n（tip：若插件设置里勾选了“隐藏后台时完全退出”，请取消勾选或分离插件Ctrl+D）`,
        uSave: '检测到当前没有打开数据自动保存功能，是否现在就开启？（随时可以在设置面板上开启或关闭，不开启的话重启utools之后数据会丢失）',
        uSync: '检测到本插件的数据在其他设备上被更改，确定同步吗？',
        openRecord: '检测到还没有开启记录搜索的功能，是否现在开启？',
        writeTxt: '【清空】- 优先去掉日期和加紧急重要标志，也清空切换的文本内容\n\n【加日期】- 可自动添加当日 或 根据“明天”“后天”“?天后”字眼自动添加日期(其中?为数字)\n\n【加链接】- 把md格式的链接转为所需(仅1个)\n\n【自动处理】- 为多项添加进行格式化\n① 处理‘-’间隔的项（前置---）；\n② 为记忆单词的英文加上[]（前英后中需前置[]，反之前置-[]）\n③ 把@标志添加到每项(注意收集箱不需要)\n\n【切】自动将内容切换到刷新任务/定期任务/日历倒计时项，若需更换切换内容要点击“清空”才能生效\n\n【外搜】(a 翻译词，w 搜索问题) +必含词 -不含词 “限定整词” site:域名 intitle:标题词 inurl:链接词 filetype:文件格式 20xx..20xx某时间段内【内搜项目】@@项目编号\n【输入框转换】“<<”转到主页输入框，“批”转到简版页输入框',
        inoutTxt: '【文本处理】\n● 选中文本 ●  只对选中内容进行查找和替换\n● 替换内容 ●  输入下面字符代表着特殊转换：\n@ZZ表转大写 @zz表转大写 @Zz表首字母大写\n● 查找内容 ●  支持正则，默认全局搜索g，输入内容可以是正则正文或字面量表达式\n○ 当查找符号/ . * + ? | ^ $ () {} [] \\ 不奏效时，大概率需要转义，即符号前加上\\，如*写成\\*。\n○ 正则中，\\d表[0-9]即任一位数字，\\w表[A-Za-z0-9]即任意一位数字或一个字母，后跟量词* + ?分别表任意个|1个以上|0或1个。\n\n【数据导入的格式有三种】\n收集箱 | 7大清单^检查卡 | 收集箱^7大清单^检查卡\n间隔符：收集箱(&) ^ 清单(~ $) ^ 检查卡(&) \n例如数据只导入收集箱，各项间用&间隔就行',
        wrongCount: '【工薪内容错误】标签+工薪\n工薪仅支持下面4种输入(以2小时共收入400为例)：\n\n① 2h&400 \n② 2h&*200\n③ 120m&400\n④ 120m&*200',
        wrongCost: '【支出内容错误】标签+支出内容\n\n支出内容必须含数值哦！！\n默认累计所有数值，数值间用非空格间隔',
        wrongForm: '【格式错误】\n\n标签和内容间需要用+号间隔',
        wrongDate: '【日期错误】请检查以下几个方面：\n\n① 所输入的日期不存在 \n② 日期的位置不在首尾 \n（若是当天数据可不输入日期）',
        wrongPeriod: '【检测月经内容是否错误】月经+行经期&月经周期\n\n正常范围的行经期为3~8天，月经周期为21~35天\n范围外的属经期紊乱症状，请格外注意，以免久拖难治',
        wrongContent: '【非安全输入】\n\n请认真检查输入内容后再尝试',
        calendarTip: '【输入】每次仅单条数据（日历将显示标签的第一个字）\n  ❶ 在输入框添加  ❷ 点击日历的某一日添加\n 单条数据包括"标签+内容 日期"\n\n【日期格式】如2022-02-22，放首或尾，不写则默认为当天\n【内容格式】金钱运算只保留两位小数\n☆ [收入] 0h&0 或 0m&0 或 0h&*0 或 0m&*0 \n☆ (前0为时间值，后0为薪水，&连接，h小时 | m分钟 *表时薪) \n☆ 所有的稳定收入都写在收入版面 (也可:红包+0h&888)\n★ [支出] 默认累计所有数值，数值间用非空格间隔\n★ 推荐分类：饮食 交通 娱乐 购物 学费 健康费 \n★ 每月固定支出写法【固定支出+……】(用于预算计算)\n○ [特殊] 自动载入定期任务和签到情况，以下是固定标签: \n○ a.药品、化妆品、食品等过期记录【期物+物品】\n○ b.经期格式【月经+行经期&月经周期】或【月经+】\n○   行经期(3~8) 月经周期(21~35)，若经期紊乱需另记录并注意\n○   只对未来2个月进行经期日期预测\n○ c.从该日期起每多少天凸显(绿框虚线)【植物+天数】\n\n【删除操作】(在点击日期后的弹出框中输入)\n▼ 删除某日用del(习惯除外)，某次经期记录删除于第一日输入periodDel\n▼ 删除当前类型的本月数据-monthDel，删除本月期物信息-termDel \n▼▼ 删除全部：某类型-typeDel ，经期-periodDelAll，植物-plantDel，全部清空需在设置面板上操作\n\n【温馨提示】\n① 可在设置面板开启“每月数据按顺序排列” \n② 习惯方面-不支持同一天写入相同的标签，更多看 帮助页-自我检测清单(线索 行为 奖励) \n③ 特殊版面可记录物品过期日期\n④ 当某月还未有数据时，可切换月份获取其他月的标签'
      };

      const monthStaticList = {
        '1': 31,
        '2': 28,
        '3': 31,
        '4': 30,
        '5': 31,
        '6': 30,
        '7': 31,
        '8': 31,
        '9': 30,
        '10': 31,
        '11': 30,
        '12': 31,
        'all': 365
      }

      let datacollectbox = tipO['collect'];
      // let onlyOne = localGet('onlyOne', 'object')?localGet('onlyOne', 'object'):{}; // 'day'一天一次



      function toLink(url) {
        // log(url) 注意啊，电脑路径在写入前把单个反斜杠替换为两个反斜杠
        var trueurl = /^(?:http|https):\/\//.test(url);
        if (window.utools) {
          trueurl ? utools.shellOpenExternal(url) : utools.shellOpenPath(url);
        } else if (trueurl) {
          window.open(url);
        }
      }

      function formatDate(data) {
        if (data * 1 < 10) {
          return '0' + data * 1;
        } else {
          return data + '';
        }
      }

      function formatDay(data) { // data格式为2022/08/01
        var it = new Date(data).getTime();
        var result = now - it;
        var str;
        if (result === 0) {
          str = '今天';
        } else if (result <= 86400000 * 15) {
          str = result / 86400000 + '天前';
        } else if (result < 86400000 * 30) {
          str = '半个月前';
        } else if (result < 86400000 * 365) {
          str = Math.floor(result / (86400000 * 30)) + '个月前';
        } else {
          str = Math.floor(result / (86400000 * 365)) + '年前';
        }
        // log(str, now, it, result)
        return str;
      }

      function formatString(val, sign, whitePlace = null) {
        let value = val && whitePlace ? val : val.trim();
        if (value) {
          let regexp = new RegExp('[' + sign + ']' + '{2,}', 'g');
          // value = value.replace('/['+ sign +']' +'{2,}/g', sign); 把有变量组合的正则字符串直接放里面是不行的
          value = value.replace(regexp, sign);
          if (value.slice(0, 1) === sign) {
            value = value.slice(1);
          }
          if (value.slice(-1) === sign) {
            value = value.slice(0, -1);
          }
          return value;
        }
      }
      var omindmapbtn = toGet('.mindmapbtn');
      omindmapbtn.onclick = function() {
        if (window.utools) {
          utools.redirect('思维导图');
          if (omindmapbtn.getAttribute('data-status') === '1') {
            window.openUtools(); // 最小化
          }
        } else {
          window.open('https://kathy_candy.gitee.io/doyouho.io/mind.html');
        }
      }

      function countBetweenDay(date, daynum = null, type = 'now', longTerm = null) {
        let time = regexDateOnly.exec(date);
        let dd = new Date(time[1], time[2] - 1, time[3]).getTime(); // 
        if (type === 'afterdays' && daynum && !isNaN(daynum)) { // (1) 返回前/后几天的年月日
          let date2 = new Date(dd + daynum * 86400000).toLocaleDateString(); // 状如2023/1/22
          let time2 = date2.replace(/(\d+)\/(\d+)\/(\d+)/, function(match, $1, $2, $3){
            return $1+'-'+formatDate($2)+'-'+formatDate($3);
          });
          // log(date2,time2);
          return time2;
        } else if (type === 'countYM' && daynum && !isNaN(daynum)) { // (2) 返回前/后几月的年月
          let m = (time[2] * 1 + daynum) % 12;
          let y = (time[2] * 1 + daynum) / 12;
          return time[1] * 1 + (m === 0 ? Math.floor(y) - 1 : Math.floor(y)) + '-' + (m <= 0 ? formatDate(12 + m) :
            formatDate(m));
          //  daynum < 0 ? Math.ceil(y) : Math.floor(y)
        } else if (type === 'betweenNum' && daynum || type === 'betweenMonth' && daynum) { // (3) 返回间隔值
          let time2 = regexDateOnly.exec(daynum);
          let ddd = new Date(time2[1], time2[2] - 1, time2[3]).getTime();
          if (longTerm) { // ① 月经计算 
            // date(dd)是渲染月的第一天，daynum是最后一个确认的经期起始日，longTerm是月经周期。月经+4&29
            let moredays = ((dd - ddd) / 86400000) % longTerm;
            if (dd - ddd > 0) {
              return longTerm - moredays + 1;
            } else {
              return -moredays + 1;
            }
          } else if (type === 'betweenNum') { // ② 两个日期间的天数
            return (dd - ddd) / 86400000;
          } else if (type === 'betweenMonth') {
            return (time[1] - time2[1]) * 12 + (time[2] - time2[2]);
          }
        } else { // (4) 返回距离今天多少日
          return (dd - now) / 86400000;
        }
      }


      function getTime() {
        var timer = new Date();
        var year = timer.getFullYear();
        var month = timer.getMonth() + 1;
        var week = timer.getDay();
        var date = timer.getDate();
        var newtoday = year + '/' + formatDate(month) + '/' + formatDate(date);
        if (year % 4 === 0 && year % 400 !== 0 || year % 400 === 0) {
          monthStaticList['2'] = 29;
          monthStaticList['all'] = 366;
        }
        if (newtoday !== today) { // 新的一天
          if (today !== '') {
            location.reload();
          }
          today = newtoday;
          todayAdd = year + '-' + formatDate(month) + '-' + formatDate(date);
          nextYM = countBetweenDay(todayAdd, 1, 'countYM');
        }

        return {
          year,
          month,
          date,
          week
        };
      }

      function toGet(selector, plural = false, type = 'unknow') {
        if (plural && type === 'unknow') {
          return document.querySelectorAll(selector);
        } else if (type === 'unknow') {
          return document.querySelector(selector);
        }
        // 当含有第三个参数时，选择器selector不带.#
        if (type === 'id') {
          return document.getElementById(selector);
        } else if (type === 'name') {
          return document.getElementsByName(selector);
        } else if (type === 'classname') { // 默认取一个值
          return plural ? document.getElementsByClassName(selector) : document.getElementsByClassName(selector)[
            0];
        }
      }


      function localSave(name, obj, type, otiptxt = null) {
        var s = obj;
        if (type === 'object') {
          s = JSON.stringify(obj);
        }

        if (window.localStorage) {
          window.localStorage.setItem(name, s);
        } else if (otiptxt) {
          otiptxt.innerText = '当前浏览器不支持localStorage语法，可尝试将浏览器升级到最新版本。';
        }
      }

      function localGet(name, type, otiptxt = null, sign = null) {

        var str = null;
        if (window.localStorage) {
          str = window.localStorage.getItem(name);
        } else if (otiptxt) {
          otiptxt.innerText = '当前浏览器不支持localStorage语法，可尝试将浏览器升级到最新版本。';
        }

        var obj = null;
        if (str) {
          if (type === 'object') {
            obj = JSON.parse(str);
          } else if (type === 'string') {
            obj = str.trim();
          } else if (type === 'list' && sign) {
            obj = str.trim().split(sign);
          }
          return obj;
        } else {
          return false;
        }
        return obj;
      }

      function localDel(name) {
        if (window.localStorage) {
          window.localStorage.removeItem(name);
        }
      }



      function sendDataOut() {
        var doitData = {
          objList: []
        };

        growData['localStr'].map(function(name) {
          doitData[name] = localGet(name, 'string') ? localGet(name, 'string') : null;
        });
        growData['localList'].map(function(name) {
          doitData[name] = localGet(name, 'object') ? localGet(name, 'object') : null;
        });
        growData['localObj'].map(function(name) {
          let temp = localGet(name, 'object') ? localGet(name, 'object') : null;
          doitData['objList'].push(temp);
        });
        return JSON.stringify(doitData);
      }

      function sendDataIn(data) {
        var doitData = JSON.parse(data);
        // log(doitData["objList"]);
        for (let name in doitData) {
          if (doitData.hasOwnProperty(name) && doitData[name] !== null) {
            if (growData['localStr'].indexOf(name) >= 0) {
              localSave(name, doitData[name]);
            } else if (name !== 'objList') {
              localSave(name, doitData[name], 'object');
            } else if (name === 'objList') {
              let templist = doitData['objList'];
              templist.map(function(val, index) {
                if (val) {
                  localSave(growData['localObj'][index], val, 'object');
                }
              });
            }

          }
        }
      }


      // 热链接的使用
      function hotlinkload(type) {
        if (linkArr) {
          if (type === 'use') {
            let ourlUl = toGet('.urlUl');
            showCustomize(linkArr, 'use', ourlUl);
          } else {
            let onew = toGet('#newAddUrl');
            showCustomize(linkArr, 'url', onew);
          }
        }

      }



      var tOutlink = null;
      var oaddUrl = toGet('.addUrl');
      var oaddBtn = toGet('.addCollectUrlBtn');
      oaddBtn.onclick = toLinkAdd;
      toGet('.urlCloseBtn').onclick = toLinkAdd;

      function toLinkAdd() {
        oaddUrl.classList.toggle('active');
        oaddUrl.getElementsByClassName('urlLink')[0].focus();
        oaddBtn.classList.toggle('active');
        toGet('#newAddUrl').classList.toggle('active');
        clearTimeout(tOutlink);
        if (window.utools) {
          utools.setSubInputValue('');
        }
      }

      var onameInput = toGet('.urlName');
      var ourlInput = toGet('.urlLink');
      var ocertainBtn = toGet('.certainBtn');
      ocertainBtn.onclick = function() {
        var ospan = oaddUrl.getElementsByClassName('tips')[0];
        var realurl = ourlInput.value;
        var truename = /^[\u4E00-\u9FA5A-Za-z0-9_-\|]+$/.test(onameInput.value);
        if (realurl === '666666' && onameInput.value === 'youho') {
          opages.classList.add('user');
          userDefined['author'] = 1;
          localSave('userDefined', userDefined, 'object');
        } else if (/^(?:http|https):\/\/[\S]+/.test(realurl) && onameInput.value === 'youho') {
          easylinkSetFun('https://www.yuque.com/nibaobao-youho/things/');
        } else {
          var trueurl = /^(?:http|https):\/\/[\S]+/.test(realurl);
          var truedirectory = /^[C-K]+:\\[\S]+/.test(realurl);
          if (truename && trueurl || window.utools && truename && truedirectory) {
            if (truedirectory) {
              realurl = realurl.replace(/\\/g, '\\\\');
            }
            var temp = 'onclick = toLink("' + realurl + '")>';
            var str =
              `<b class='${truedirectory?'filelink link':'link'}'><span ${temp + onameInput.value}</span></b>`;
            if (linkArr.length > 0) {
              linkArr.push(str);
            } else {
              linkArr[0] = str;
            }
            dataObj['hotlinkArr'] = linkArr;
            localSave('dataObj', dataObj, 'object');
            let onew = toGet('#newAddUrl');
            showCustomize(linkArr, 'url', onew);
            ospan.innerText = tipO['successUrl'];
            onameInput.value = '';
            ourlInput.value = '';
          } else {
            ospan.innerText = tipO['errorUrl'];
          }
          tOutlink = setTimeout(function() {
            ospan.innerText = '(提示区)';
          }, 2000);
          tolinkReferFun();
        }

      }

      var oopenInoutBtn = toGet('.openInoutBtn');
      oopenInoutBtn.onclick = openInoutWrite;

      function openInoutWrite(type) {
        var oinoutWrapper = toGet('.inoutWrapper');
        var originFile = toGet('.originFile');
        if (type === 'open') { // 框导入用的？
          oinoutWrapper.classList.add('active');
          originFile.classList.add('active');
          oopenInoutBtn.innerText = '隐';
        } else {
          if (oopenInoutBtn.innerText === '显') {
            oinoutWrapper.classList.add('active');
            originFile.classList.add('active');
            originFile.classList.add('open');
            oopenInoutBtn.innerText = '隐';
          } else {
            oopenInoutBtn.innerText = '显';
            oinoutWrapper.classList.remove('active');
            originFile.classList.remove('active');
            originFile.classList.remove('open');
          }
        }
      }
      var oinoutControl = toGet('.inoutControl');
      const osureReplaceBtns = toGet('.sureReplaceBtn', true);
      const ofindcontent = toGet('.findcontent');

      function inputRegExp(newstr = null) { // 查找结果突出
        let txt0 = toGet('.findtext').value;
        let temp = writeBoxForCopy.value.trim();
        let txt1 = selectTxt(writeBoxForCopy) ? selectTxt(writeBoxForCopy) : temp;
        let ospans = toGet('.findcount', true);
        let oordernumOl = toGet('.ordernumOl');
        osureReplaceBtns[0].classList.remove('active');
        osureReplaceBtns[1].classList.remove('active');
        txt1 = isSaveItem(txt1); // 判断合法性，嵌入
        let reg = null;
        if (txt1) {
          ospans[0].innerText = txt1.replace(/\s/g, '').length;
          let linenum = txt1.match(/\n/g) ? txt1.match(/\n/g).length + 1 : 1;
          ospans[1].innerText = linenum;
          let ordertxt = '';
          let manyTimes = 0;
          if (txt0 !== '') {
            //这里的变量txt0是输入框value值，不需要转换了
            if (txt0.indexOf('/') === 0 && txt0.lastIndexOf('/') > 0) {
              //写了/xx/的话需取出数据
              let iidx = txt0.lastIndexOf('/');
              let flags = /^[gimyus]+$/.test(txt0.slice(iidx + 1)) ? txt0.slice(iidx + 1) : 'g';
              let contxt = txt0.slice(1, iidx).replace(/\s/g, '\\s+');
              reg = new RegExp(contxt, flags);
            } else { // 非字面量输入
              let contxt = txt0.replace(/\s/g, '\\s+');
              reg = new RegExp(contxt, 'g');
            }
            txt1 = txt1.replace(reg, function(item) {
              manyTimes++;
              if (typeof newstr === 'string') {
                return '<span class="delmark">' + item + '</span><span class="mark">' + newstr + '</span>';
              } else {
                return '<span class="mark">' + item + '</span>';
              }
            });
          }
          txt1 = txt1.replace(/\n/g, '<br>');
          txt1 = txt1.replace(/(?<!span)\s/g, '&nbsp;'); // 转换是为了连续多个空格能保留
          ospans[2].innerText = manyTimes;
          for (let i = 1; i <= linenum; i++) {
            ordertxt = ordertxt + '<li>' + i + '</li>';
          }
          oordernumOl.innerHTML = ordertxt;
          ofindcontent.innerHTML = txt1;
          osureReplaceBtns[1].setAttribute('data-tmp', '0');
          toMainSquare(6);
        }
        return reg;
      }

      oinoutControl.onclick = function(e) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'SPAN') {
          var index = ele.getAttribute('data-index');
          var oinputs = oinoutControl.querySelectorAll('input');
          let temp = writeBoxForCopy.value;
          if (index === '0') { // 替换
            let ttt = oinputs[1].value;
            let ttselect = selectTxt(writeBoxForCopy);
            let changeTxt = ttselect ? ttselect : temp;
            let type = 'char';

            if (/^@[ZZ|Zz|zz]+/.test(ttt)) {
              let val = /\b([\w]+)\b/gm;
              changeTxt = changToFun(changeTxt, ttt, val);

              function changToFun(temmp, ttt, val) {
                if (/^@ZZ/.test(ttt)) {
                  temmp = temmp.replace(val, function(l) {
                    return l.toUpperCase();
                  });
                } else if (/^@Zz/.test(ttt)) {
                  temmp = temmp.replace(val, function(m) {
                    return m.substring(0, 1).toUpperCase() + m.substring(1).toLowerCase();
                  });
                } else if (/^@zz/.test(ttt)) {
                  temmp = temmp.replace(val, function(n) {
                    return n.toLowerCase();
                  });
                }
                return temmp;
              }

            } else {
              type = 'replace';
              let reg = inputRegExp(ttt);
              osureReplaceBtns[1].setAttribute('data-content', '替换 · 匹配值换成' + ttt + '时');
              osureReplaceBtns[1].setAttribute('data-regexp', '匹配 · 正则表达式为' + reg);
              changeTxt = changeTxt.replace(reg, ttt);
            }
            if (ttselect) {
              let begin = writeBoxForCopy.selectionStart;
              let ttemp = temp.substring(begin);
              ttemp = ttemp.replace(selectTxt(writeBoxForCopy), changeTxt);
              temp = temp.substring(0, begin) + ttemp;
            } else {
              temp = changeTxt;
            }
            if (type === 'char') {
              writeBoxForCopy.value = temp;
            } else {
              growData['txtReplace'] = temp;
              osureReplaceBtns[0].classList.add('active');
              osureReplaceBtns[1].className = 'sureReplaceBtn statusReBtn active';
            }
          } else if (index === '1') { // 清空输入框
            oinputs[0].value = '';
            oinputs[1].value = '';
          } else if (index === '2') { // md转HTML
            let templist = temp.split('\n');
            for (let vv = 0; vv < templist.length; vv++) {
              if (/http/.test(templist[vv])) {
                templist[vv] = linkSolved(templist[vv], 'mdtoLink');
              }
            }
            temp = templist.join('\n');
            writeBoxForCopy.value = temp;
          }
        }
      }

      function selectTxt(obj) {
        var staIndex = obj.selectionStart;
        var endIndex = obj.selectionEnd;
        if (/input|textarea/i.test(obj.tagName) && /firefox/i.test(navigator.userAgent)) {
          //Firefox在文本框内选择文字 
          if (staIndex != endIndex) {
            var sText = obj.value.substring(staIndex, endIndex);
            return sText;
          } else {
            return false;
          }
        } else {
          //获取选中文字 
          var sText = document.selection == undefined ? document.getSelection().toString() : document.selection
            .createRange().text;
          return sText; // 可能为 ''
        }
      }

      osureReplaceBtns[0].onclick = function() { // 确认切换
        writeBoxForCopy.value = growData['txtReplace'];
        osureReplaceBtns[0].classList.remove('active');
        osureReplaceBtns[1].classList.remove('active');
        toMainSquare(6);
      }
      osureReplaceBtns[1].onclick = function() { // 查找内容
        let status = osureReplaceBtns[1].getAttribute('data-tmp') * 1;
        if (!status) {
          growData['txtReplaceHTML'] = ofindcontent.innerHTML;
          osureReplaceBtns[1].setAttribute('data-tmp', '1');
        }
        let old = growData['txtReplaceHTML'];
        if (osureReplaceBtns[1].innerText === '匹配结果') {
          ofindcontent.innerHTML = old.replace(/<span class="delmark">(.*?)<\/span><span class="mark">(.*?)<\/span>/g,
            '<span class="mark">$1</span>');
          osureReplaceBtns[1].innerText = '替换结果';
          osureReplaceBtns[1].className = 'sureReplaceBtn statusReBtn dofind active';
        } else {
          ofindcontent.innerHTML = old.replace(/<span class="delmark">(.*?)<\/span><span class="mark">(.*?)<\/span>/g,
            '<span class="mark">$2</span>');
          osureReplaceBtns[1].innerText = '匹配结果';
          osureReplaceBtns[1].className = 'sureReplaceBtn statusReBtn doreplace active';
        }
      }

      function showCustomize(list, type, obj) {
        let allStr = '';
        let temp = '';
        // 链接互用部分
        if (type === 'tag' && oldhtml) {
          allStr = oldhtml;
        }
        for (let i = 0; i < list.length; i++) {
          if (type === 'use') {
            temp = '<li>' + i + ' ' + list[i] + '</li>';
          } else if (type === 'url') {
            temp = list[i].replace('</b>', "<i class=\"smalldelbtn\" data-index='" + i +
              "' onclick='delectOne(this)'>-</i></b>");
          } else if (type === 'tag') {
            let tmpval = list[i];
            if (tmpval.indexOf('|') !== -1) {
              let x = tmpval.indexOf('|');
              tmpval = tmpval.slice(x + 1).trim();
            }
            temp = '<b class="tag"><span>' + tmpval + '</span><i class="smalldelbtn" data-index="' + i +
              '" onclick="delectOne(this)">-</i></b>';
          }
          allStr += temp;
        }
        obj.innerHTML = allStr;
      }

      function delectOne(e) {
        event.preventDefault();
        let type = e.parentElement.className;
        let index = e.getAttribute('data-index');
        if (type.indexOf('link') !== -1) {
          linkArr.splice(index, 1);
          let onew = toGet('#newAddUrl');
          dataObj['hotlinkArr'] = linkArr;
          showCustomize(linkArr, 'url', onew);
        } else if (type === 'tag') {
          tagArr.splice(index, 1);
          dataObj['taglist'] = tagArr;
          showCustomize(tagArr, 'tag', otagstatus);
        }
        localSave('dataObj', dataObj, 'object');
      }

      const odotype = toGet('.odotype');
      const obetterway = toGet('.obetterway');
      const otaskMentionNum = toGet('.taskMentionNum');
      var ocountdowncon = toGet('.countdownconTxt');
      var oisPlayAudio = toGet('.isPlayAudio');

      function userdefinedfun(type = 'ok') {
        var ouserDefined = localGet('userDefined', 'object');
        if (ouserDefined) {
          userDefined = ouserDefined;
          if (userDefined['author']) {
            opages.classList.add('user');
          }
          var tempdiffval = Math.round(userDefined['difficult'] * 100);
          if (userDefined['doType']) {
            odotype.innerText = userDefined['doType'];
            littleset('newset', null, 'doType');
          } else {
            odotype.innerText = '……默认项……';
          }
          if (userDefined['betterWay']) {
            obetterway.innerText = userDefined['betterWay'];
            littleset('newset', null, 'betterWay');
          } else {
            obetterway.innerText = '……默认项……';
          }
          if (userDefined['countdown']) {
            txtData['countDown'] = userDefined['countdown'];
            ocountdowncon.innerText = txtData['countDown'];
            ocountdownTxt.classList.add('show');
            countdownFun(txtData['countDown']);
          } else {
            txtData['countDown'] = '';
            ocountdownTxt.innerText = '';
            ocountdownTxt.classList.remove('show');
            ocountdowncon.innerText = '（暂无）';
          }

          if (userDefined['restTime']) {
            var tempRestTime = userDefined['restTime'];
          } else {
            var tempRestTime = 300;
          }
          if (type === 'ok') {
            stopRunning('stop');
          }
          let wrongtxt = '';
          if (userDefined['levela'] < userDefined['levelb']) {
            wrongtxt = '(无效)';
          }
          if (userDefined['tomato']) {
            growData['tomatoTime'] = userDefined['tomato'] ? userDefined['tomato'] : '25+5';
          }
          let definedInputs = document.querySelectorAll('.firstCon input');
          definedInputs[0].setAttribute('placeholder', '工作+休息' + growData['tomatoTime'] + '分钟');
          definedInputs[1].setAttribute('placeholder', '现值：' + tempRestTime + '(秒)');
          definedInputs[2].setAttribute('placeholder', '现值：' + userDefined['tasknum']);
          definedInputs[3].setAttribute('placeholder', '现值：' + tempdiffval + ' (即' + tempdiffval + '%)');
          definedInputs[4].setAttribute('placeholder', '现值：' + userDefined['levela']);
          definedInputs[5].setAttribute('placeholder', '现值：' + userDefined['levelb'] + wrongtxt);
          definedInputs[6].setAttribute('placeholder', '现值：' + userDefined['taskMentionTime'] + '(天)');
          otaskMentionNum.innerText = userDefined['taskMentionTime'] ? userDefined['taskMentionTime'] : 3;
          var num = userDefined['themeMode'];
          if (num >= 0) {
            var othemechooses = toGet('.themechoose', true);
            othemechooses[num].checked = true;
            chooseTheme(num);
          }
          var index = userDefined['searchWeb'];
          if (index >= 0) {
            n_searchChoose = index;
            osearchModes[index].checked = true;
            txtData['searchCondition'] = growData['searchName'][index] + '·改' + (userDefined['recordSearchChose'] ?
              ' (记录中)' : '');
            otoWebSearchBtn.innerText = txtData['searchCondition'];
            oworktoWebSearchBtn.setAttribute('data-tip', growData['searchName'][index]);
            menuBtns[16].innerText = txtData['searchCondition'];
          }
          var odeletechoose = toGet('.deletechoose');
          var ooutputchoose = toGet('.outputchoose');
          var ounshowNonechoose = toGet('.unshowNonechoose');
          var orecordchoose = toGet('.recordchoose');
          recordSearchStr = localGet('searchData', 'string') ? localGet('searchData', 'string') : '';
          var ocalendarsortchoose = toGet('.calendarsortchoose');
          var ocontrolchoose = toGet('.controlchoose');

          if (!window.utools) {
            var oaudiochoose = toGet('.audiochoose');
            oisPlayAudio.style.display = 'block';
            toggleFun('audioChose', 1, oaudiochoose);
          } else {
            var osavelocalchoose = toGet('.savelocalchoose');
            toggleFun('saveLocalChose', 1, osavelocalchoose);
          }

          toggleFun('deleteChose', 1, odeletechoose);
          toggleFun('outputChose', 'simple', ooutputchoose);
          toggleFun('unshowNoneChose', 1, ounshowNonechoose);
          toggleFun('recordSearchChose', 1, orecordchoose);
          toggleFun('controlChose', 1, ocontrolchoose);
          toggleFun('calendarSortChose', 1, ocalendarsortchoose);
          if (userDefined['calendarSortChose']) {
            osortCalendarBtn.innerText = '逆序';
            dsortType = '1';
          } else {
            osortCalendarBtn.innerText = '顺序';
            dsortType = '0';
          }
          if (userDefined['controlChose']) {
            opages.classList.add('ok');
            ocontent.classList.add('ok');
          }

          function toggleFun(name, isval, obj) { // 上状态
            if (userDefined[name] === isval) {
              obj.setAttribute('data-txt', '关闭');
              obj.classList.add('active');
            } else {
              obj.setAttribute('data-txt', '开启');
              obj.classList.remove('active');
            }
          }

        }
      }
      
      function moveBasicData(){ // 数据转移=>没值则取值
        if(!dataObj['badmoon']){     // 字符串
          if(localGet('badmoon','string')){
            dataObj['badmoon'] = localGet('badmoon','string');
            localDel('badmoon');
          }else{
            dataObj['badmoon'] = null;
          }
        }
        if(!dataObj['lastDaka']){    // 字符串
          if(localGet('lastDaka','string')){
            dataObj['lastDaka'] = localGet('lastDaka','string');
            localDel('lastDaka');
          }else{
            dataObj['lastDaka'] = null;
          }
        }
        if(!dataObj['defaultTask']){ // 字符串
          if(localGet('defaultTask','string')){
            dataObj['defaultTask'] = localGet('defaultTask','string');
            localDel('defaultTask');
          }
        }
        if(!dataObj['hotlinkArr']){    // 原字符串 -- 后数组 linkArr
          if(localGet('hotlink','string')){
            dataObj['hotlinkArr'] = localGet('hotlink','list', null, '^');
            linkArr = dataObj['hotlinkArr'];
            localDel('hotlink');
          }else{
            dataObj['hotlinkArr'] = [];
          }
        }
        if(!dataObj['taglist']){       // 数组 tagArr
          if(localGet('taglist','object')){
            dataObj['taglist'] = localGet('taglist','object');
            tagArr = dataObj['taglist'];
            localDel('taglist');
            showCustomize(tagArr, 'tag', otagstatus);
          }else{
            dataObj['taglist'] = [];
          }
        }
        if(!dataObj['filedlist']){     // 数组 filedArr 特意删
          if(localGet('filedlist','object')){
            dataObj['filedlist'] = localGet('filedlist','object');
            filedArr = dataObj['filedlist'];
            localDel('filedlist');
          }else{
            dataObj['taglist'] = [];
          }
        }
        if(!dataObj['linkconnectObj']){   // 对象 linkConnectObj 特意删
          if(localGet('linkconnect','object')){
            dataObj['linkconnectObj'] = localGet('linkconnect','object');
            linkConnectObj = dataObj['linkconnectObj'];
            localDel('linkconnect');
          }else{
            dataObj['linkconnectObj'] = {};
          }
        }
        
        
        localSave('dataObj', dataObj, 'object');
      }
     
      var omenu = toGet('.menu');
      var omoremenubtn = toGet('.moremenubtn');
      omoremenubtn.onclick = function() {
        let old = this.getAttribute('data-status');
        if (old === '0') {
          this.setAttribute('data-status', '1');
          omenu.classList.add('more');
          this.classList.add('active');
        } else {
          this.setAttribute('data-status', '0');
          omenu.classList.remove('more');
          this.classList.remove('active');
        }
      }

      var otoshowmenu = toGet('.toshowmenu');
      otoshowmenu.onclick = function() {
        let old = this.getAttribute('data-status');
        if (old === '0') {
          this.setAttribute('data-status', '1');
          oasidemenu.classList.add('show');
          this.innerText = '<<';
        } else {
          this.setAttribute('data-status', '0');
          oasidemenu.classList.remove('show');
          this.innerText = '>>';
        }
      }
      var otoRightFixbtn = toGet('.toRightFixbtn');
      otoRightFixbtn.onclick = function() {
        omain.classList.remove('active');
        omain.classList.add('fixed');
        aside.classList.add('fixed');
        aside.style.display = 'block';
      }
      // 坏心情的记录
      var ohandstar = toGet('.handstand-heart');

      function badmoonRec(badmoonstr) {
        var nowmoon = false;
        badmoonstr = badmoonstr === null && dataObj['badmoon'];
        if (badmoonstr) { // 有存储的数据 判断今天有没有标记
          if (badmoonstr.indexOf(today) !== -1) {
            ohandstar.classList.add('active');
            nowmoon = true;
          }
          badmoonArr = badmoonstr.split('^');
          if (badmoonArr.length > 30) {
            dataObj['badmoon'] = badmoonArr.slice(-30).join('^');
            localSave('dataObj', dataObj, 'object');
          }
        }
        ohandstar.onclick = function() {
          getTime();
          // 存日期 
          if (!nowmoon) {
            ohandstar.classList.add('active');
            if (badmoonArr) {
              badmoonArr[badmoonArr.length] = today;
            } else {
              badmoonArr[0] = today;
            }
            dataObj['badmoon'] = badmoonArr.join('^');
            localSave('dataObj', dataObj, 'object');
            if(localGet('badmoon', 'string')){
              localDel('badmoon');
            }
            checkSummary();
          }
        }
      }
    </script>
    <script>
      const otagstatus = toGet('.tagstatus');
      let oldhtml = otagstatus.innerHTML;
      var sortBoxStr = '';
      var beforeData = {
        sortList: [],
        tmpRecycle: [],
        tmpReference: [],
        tmpMaylist: [],
        tmpProject: [],
        tmpWaitlist: [],
        tmpDaylist: [],
        tmpDolist: [],
        checkList: [],
        summaryList: []
      }
      var finishList = [];
      var solveUl = null; // 添加数据时，表示当前选中的列表
      var nowlistStr = '';
      var dechangeIdlId = -1;
      var omemory = {};
      var memorylist = [];


      var refresh = toGet('.tmpRefreshA');
      var recycle = toGet('.tmpRecycle');
      var reference = toGet('.tmpReference');
      var maylist = toGet('.tmpMaylist');
      var project = toGet('.tmpProject');
      var waitlist = toGet('.tmpWaitlist');
      var daylist = toGet('.tmpDaylist');
      var dolist = toGet('.tmpDolist');
      var thingsNums = toGet('.thingsNum', true);
      var places = toGet('.analyzeCon .detail', true);

      // 数据更新
      // 添加式库collectBox($分隔符，)  覆盖式库collectBoxNew
      // notFirstSave collectIndex solvedAll  分类库collectSortBox（先~后$划分）
      var datalist = ['tmpDolist', 'tmpDaylist', 'tmpWaitlist', 'tmpProject', 'tmpMaylist', 'tmpReference',
        'tmpRecycle'
      ];

      function strToList(str) {
        if (str) {
          var sortBoxArr = str.split('~');
          for (let b = 0; b < sortBoxArr.length; b++) {
            let key = datalist[b];
            if (/\$+/.test(sortBoxArr[b])) {
              let arr = sortBoxArr[b].split('$');
              // arr.shift();
              beforeData[key] = arr;
            } else if (sortBoxArr[b].trim()) {
              beforeData[key][0] = sortBoxArr[b];
            }
          }

          let s0 = localGet('checklist', 'object');
          if (s0) {
            beforeData.checkList = s0;
          }
          let s1 = localGet('summarylist', 'object');
          if (s1) {
            beforeData.summaryList = s1;
          }
          let s2 = localGet('finishlist', 'object');
          if (s2) {
            finishList = s2;
          }
          origin();
          // log(beforeData.sortList);
        } else {
          log('内存中暂时没有数据');
        }
      }

      var oitemnumBtns = toGet('.itemnumBtn', true);
      var oitemsignBtn = toGet('.itemsignBtn');
      var oitemsign = toGet('.itemsign'); // 输入框
      var oitemAllPeriod = toGet('.itemAllPeriod');

      var oitemselect = toGet('.itemselect');
      var oremarkstxt = toGet('.remarkstxt');
      var osignTxt = toGet('.signTxt');
      var oitemNameTxt = toGet('.itemNameTxt');
      var oitemsection = toGet('.itemsection');
      // 项目管理 打开与关闭
      function itemOpen(itemid = '') {
        existItemArr = localGet('existItem', 'object') ? localGet('existItem', 'object') : ['模板'];
        let options = existItemArr.map((x) => '<option value="' + x + '">' + x + '</option>');
        oitemselect.innerHTML = options.join('');
        oitemsign.value = '';
        itemid = itemid || oitemselect.value;
        oitemselect.value = itemid;
        oitemselect.setAttribute('data-id', itemid);
        refreshItemData();
      }

      function itemClose() {
        let itemid = oitemselect.value;
        if (itemObj[itemid]) {
          itemObj[itemid][2] = oremarkstxt.innerText;
          localSave('itemObj', itemObj, 'object');
        }
      }

      oitemselect.onclick = function() {
        let oldid = oitemselect.getAttribute('data-id');
        if (oldid !== oitemselect.value) {
          oitemnumBtns[0].classList.remove('unactive');
        } else {
          oitemnumBtns[0].classList.add('unactive');
        }
      }

      oitemnumBtns[0].onclick = toggleItem;
      oitemnumBtns[1].onclick = toggleItem;
      oitemnumBtns[2].onclick = function() { // 归档: 项目完成并移除  编号另分filedArr  数据不再更新
        var itemid = oitemselect.value;
        let obj = itemObj[itemid] ? itemObj[itemid][1] : {};
        let num = Object.getOwnPropertyNames(obj).length;
        if (!this.classList.contains('unactive') && num > 0) {
          var olis = project.querySelectorAll('li');
          for (let t = 0; t < olis.length; t++) {
            let sign = olis[t].getAttribute('data-sign');
            if (sign === itemid) {
              if (itemObj[sign]) {
                itemObj[sign][3] = '(归档于' + today + ')';
                itemObj[sign][2] = oremarkstxt.innerText;
                oitemNameTxt.innerText = itemObj[sign][0] + ' ' + itemObj[sign][3];
              }
              project.removeChild(olis[t]);
              beforeData['tmpProject'].splice(t, 1);
              saveData();
              break;
            }
          }
          oitemsection.classList.add('over');
          filedArr.push(itemid);
          dataObj['filedlist'] = filedArr;
          localSave('dataObj', dataObj, 'object');
          localSave('itemObj', itemObj, 'object');
        }
      }

      oitemnumBtns[3].onclick = function() {
        if (!this.classList.contains('unactive')) {
          let val = '@@' + oitemselect.value;
          toMainSquare(1);
          tosearchtag(val);
        }
      }

      function toggleItem() {
        var model = this.innerText;
        let oldid = oitemselect.getAttribute('data-id');
        var itemid = oitemselect.value;
        oitemsign.value = '';
        if (oldid !== '模板') {
          itemObj[oldid][2] = oremarkstxt.innerText;
          localSave('itemObj', itemObj, 'object');
        }

        if (model === '刷新' && oldid !== '模板') { // 当前不是模板时刷新数据
          refreshItemData();
        } else if (model === '切换项目' && oldid !== itemid) { // 当前项目和所选项目不一致时执行切换
          oitemselect.setAttribute('data-id', itemid);
          oitemnumBtns[0].classList.add('unactive');
          oitemnumBtns[2].classList.add('unactive');
          oitemsection.classList.remove('over');
          if (itemid === '模板') {
            oitemnumBtns[3].classList.add('unactive');
            oitemNameTxt.innerText = '帮助&介绍';
            oremarkstxt.innerText = '( 项目相关内容：时间段 备注 注意事项等 )';
            osignTxt.innerHTML = '<span>模板标志</span>';
            oitemAllPeriod.innerHTML = txtData['itemHTML'];
            let progressback = oitemAllPeriod.querySelector('.itemprogressback');
            progressback.style.width = Math.round(6 / 15 * 100) + '%';
            progressback.querySelector('mark').innerText = Math.round(6 / 15 * 100) + '%';

          } else {
            oitemnumBtns[3].classList.remove('unactive');
            itemChoseFun();
          }
        } else if (model === '刷新' && oldid === '模板') {
          tellyouTip(tellO['helpFresh'], 'tip');
        }
      }

      function itemChoseFun() { // 切换项目/刷新
        // 切换前要保存备注
        var itemid = oitemselect.value;
        var spans = '';
        oitemAllPeriod.innerHTML = '';
        var list = itemObj[itemid] ? itemObj[itemid] : null;
        if (list) {
          var title = list[0] ? list[0] : itemid;
          var tip = list[2] ? list[2] : '备注：';
          var signobj = list[1];
          oremarkstxt.innerText = tip;
          if (filedArr.indexOf(itemid) !== -1) {
            oitemsection.classList.add('over');
            oitemNameTxt.innerText = title + ' ' + list[3];
          } else {
            oitemsection.classList.remove('over');
            oitemNameTxt.innerText = title;
          }
          var num = 0;
          var isOk = true;
          itemO['signO'] = {};
          if (signobj) {
            for (let sign in signobj) {
              spans = spans + '<span>' + sign + '</span>';
              itemO['signO'][sign] = num;
              num++;
              // sign为标志 name为阶段名 objdata有3个属性
              let name = signobj[sign][0];
              let objdata = signobj[sign][1];
              let [operiod, isfinish] = itemBuild(sign, objdata, name);
              isOk = isOk && isfinish;
              oitemAllPeriod.appendChild(operiod);
            }
            osignTxt.innerHTML = spans;
            if (isOk) {
              oitemnumBtns[2].classList.remove('unactive');
            } else {
              oitemnumBtns[2].classList.add('unactive');
            }
          }

        } else {
          oitemnumBtns[3].classList.add('unactive');
        }
      }

      oitemsignBtn.onclick = createPeriod;

      function createPeriod() {
        var val = oitemsign.value;
        var itemid = oitemselect.value; //编号
        // 阶段内容生成
        if (val && val.indexOf('|') !== -1 && itemObj[itemid]) {
          var index = val.indexOf('|');
          var name = val.slice(0, index) ? val.slice(0, index) : '某阶段';
          var sign = val.slice(index + 1).trim();
          var obj = itemObj[itemid][1]; // 阶段标志对象
          if (obj[sign]) {
            // 如果标志已存在，则改名
            var operiodNames = toGet('.periodName', true);
            let namenum = itemO['signO'][sign] ? itemO['signO'][sign] : null;
            if (!namenum) {
              var ops = osignTxt.querySelectorAll('span');
              for (let t = 0; t < ops.length; t++) {
                if (ops[t].innerText === sign) {
                  namenum = t;
                  break;
                }
              }
            }
            operiodNames[namenum].innerText = name + '(@' + sign + ')';
            oitemsign.value = '(更名成功)';
            obj[sign][0] = name;
          } else if (/^[a-z-_\u4e00-\u9fa5]+$/.test(sign)) {
            oitemnumBtns[2].classList.add('unactive');
            var ospan = document.createElement('span');
            ospan.innerText = sign;

            obj[sign] = ['阶段名', {}, '创建日期'];
            obj[sign][2] = today;
            let objdata = signToItem(sign, itemid);
            obj[sign][1] = objdata;
            let [operiod] = itemBuild(sign, objdata, name);
            oitemAllPeriod.appendChild(operiod);
            osignTxt.appendChild(ospan);
            oitemsign.value = '(新增成功)';
            obj[sign][0] = name;
          } else {
            tellyouTip(tellO['warnSign'], 'tip');
          }
          itemObj[itemid][2] = oremarkstxt.innerText; // 备注获取
          localSave('itemObj', itemObj, 'object');
        } else if (!itemObj[itemid]) {
          oitemsign.value = '';
          tellyouTip(tellO['helpSign'], 'tip');
        } else if (val.indexOf('|') === -1) {
          tellyouTip(tellO['addSign'], 'tip');
        }
      }

      function refreshItemData() {
        // 根据编号把事项更新一遍+
        var itemid = oitemselect.value; //编号
        var signobj = itemObj[itemid] ? itemObj[itemid][1] : null;
        if (signobj) {
          oitemnumBtns[3].classList.remove('unactive');
          for (let sign in signobj) {
            signobj[sign][1] = signToItem(sign, itemid);
          }
          itemChoseFun();
        } else {
          oitemnumBtns[3].classList.add('unactive');
          oitemsection.classList.remove('over');
          oitemNameTxt.innerText = '帮助&介绍';
          oremarkstxt.innerText = '( 项目相关内容：时间段 备注 注意事项等 )';
          osignTxt.innerHTML = '<span>模板标志</span>';
          oitemAllPeriod.innerHTML = txtData['itemHTML'];
          let progressback = oitemAllPeriod.querySelector('.itemprogressback');
          progressback.style.width = Math.round(6 / 15 * 100) + '%';
          progressback.querySelector('mark').innerText = Math.round(6 / 15 * 100) + '%';
          oitemnumBtns[2].classList.add('unactive');
        }
      }

      function signToItem(sign, id) {
        // datacollectbox beforeData['tmpDolist'] finishList
        let obj = {
          'plan': [],
          'todo': [],
          'done': []
        };
        let pre = '@' + sign + ' ';
        let rex = new RegExp('^' + pre, 'g');
        let index = sign.length + 2;
        let threelist = beforeData['tmpDolist'].concat(beforeData['tmpDaylist'], beforeData['tmpWaitlist']);
        obj['plan'] = datacollectbox.filter(function(item) {
          if (rex.test(item) || item.indexOf(pre) === 0) {
            return item;
          }
        }).map(item => item.slice(index));
        obj['todo'] = threelist.filter(function(item) {
          if (rex.test(item) || item.indexOf(pre) === 0) {
            return item;
          }
        }).map(item => item.slice(index));

        let signobj = itemObj[id] ? itemObj[id][1] : null;
        let signdate = signobj ? (signobj[sign] ? signobj[sign][2] : null) : null;
        let lastDelFinishDate = localGet('lastDelFinishDate', 'object') ? localGet('lastDelFinishDate',
          'object') : [];
        let lastkeep = [];
        for (let m = 0; m < lastDelFinishDate.length; m++) {
          if (signdate <= lastDelFinishDate[m]) {
            // 得用之前存的含标志数据
            var oldfinishItem = localGet('oldfinishItem', 'object') ? localGet('oldfinishItem', 'object') : [];

            if (oldfinishItem[m] && oldfinishItem[m][sign]) {
              lastkeep = lastkeep.concat(oldfinishItem[m][sign]);
            }
          }
        }

        // 2022/02/10 (执)
        let nowfinish = finishList.filter(function(item) {
          let value = item.slice(15);
          if (rex.test(value) || value.indexOf(pre) === 0) {
            return item;
          }
        }).map(item => item.slice(0, 11) + ' ' + item.slice(index + 15));
        obj['done'] = lastkeep.concat(nowfinish);

        // log(obj['plan'], obj['todo'], obj['done'])
        return obj;
      }

      function itemBuild(sign, objdata, name) {
        var odiv = document.createElement('div');
        odiv.className = 'itemPeriod';
        odiv.setAttribute('data-sign', sign);
        var datali = ['', '', ''];
        var li0 = objdata['plan'];
        var li1 = objdata['todo'];
        var li2 = objdata['done'];
        var isfinish = false;
        if (li0.length > 0) {
          datali[0] = li0.map((item) => '<li>' + item + '</li>').join('');
        }
        if (li1.length > 0) {
          datali[1] = li1.map((item) => '<li><span class="cbox"></span><b class="item">' + item + '</b></li>')
            .join(
              '');
        }
        if (li2.length > 0) {
          datali[2] = li2.map((item) => '<li><span class="cbox"></span><b class="item">' + item + '</b></li>')
            .join('');
        }
        var template =
          '<div class="itemStatus" data-show="1" onclick="showWrapper(this)"><div class="itemprogressback"><mark></mark></div><span>></span><div class="periodName">' +
          name + '(@' + sign + ')</div><div class="periodCount">计划(<b>' +
          li0.length + '</b>) 进行(<b>' +
          li1.length + '</b>) 完成(<b>' +
          li2.length +
          '</b>)</div></div><div class="itemCon-wrapper"><div><p class="p-title">计划中-收集箱：<span class="btn itemAddBtn" onclick="writeLayer(\'itemadd\', \'' +
          sign + '\')">+</span></p>' +
          '<ul class="itemplanUl">' + datali[0] +
          '</ul></div><div><p class="p-title">进行中-清单项(可一步搞定的)：</p>' +
          '<ul class="detail itemtodoUl">' + datali[1] +
          '</ul><ul class="detail itemdoneUl">' + datali[2] +
          '</ul></div></div>';
        odiv.innerHTML = template;
        let alllength = li0.length + li1.length + li2.length;
        let percent = alllength ? Math.round(li2.length / alllength * 100) + '%' : '0%';
        odiv.querySelector('.itemprogressback').style.width = percent;
        if (percent !== '0%') {
          if (percent === '100%') {
            isfinish = true;
            odiv.querySelector('mark').innerText = '';
            odiv.querySelector('mark').className = 'hidden';
            odiv.querySelector('.itemprogressback').className = 'itemprogressback finish';
          } else {
            odiv.querySelector('mark').innerText = percent;
            odiv.querySelector('mark').className = '';
          }
        } else {
          odiv.querySelector('mark').className = 'hidden';
        }
        return [odiv, isfinish];
      }
      var oitemsignDelBtn = toGet('.itemsignDelBtn');

      oitemsignDelBtn.onclick = function() {
        var itemid = oitemselect.value; //编号
        var obj = itemObj[itemid] ? itemObj[itemid][1] : null;
        if (!obj) {
          tellyouTip(tellO['helpDelSign'], 'tip');
        } else {
          oitemsign.value = '';
          tellyouTip(tellO['delSign'], '删除标志', obj);
        }
      }

      function itemsignDelFun(obj, sign) {
        if (obj[sign]) {
          delete obj[sign];
          localSave('itemObj', itemObj, 'object');
          // html处理
          let namenum = itemO['signO'][sign] ? itemO['signO'][sign] : null;
          var ops = osignTxt.querySelectorAll('span');
          var oitemPeriods = oitemAllPeriod.querySelectorAll('.itemPeriod');
          if (!namenum) {
            for (let t = 0; t < ops.length; t++) {
              if (ops[t].innerText === sign) {
                namenum = t;
                break;
              }
            }
          }
          osignTxt.removeChild(ops[namenum]);
          oitemAllPeriod.removeChild(oitemPeriods[namenum]);
        }
      }

      var oitemsmallBtn = toGet('.itemsmallBtn');
      oitemsmallBtn.onclick = function() {
        var otitles = oitemAllPeriod.querySelectorAll('.itemStatus');
        var owrappers = oitemAllPeriod.querySelectorAll('.itemCon-wrapper');
        for (let i = 0; i < otitles.length; i++) {
          owrappers[i].classList.add('hidden');
          otitles[i].setAttribute('data-show', '0');
          otitles[i].querySelector('span').classList.add('unshow');
        }
        oitemsign.value = '';
      }
      var oitemDelBtn = toGet('.itemDelBtn');
      oitemDelBtn.onclick = function() { // 删掉关联
        oitemsign.value = '';
        var itemid = oitemselect.value; //编号
        if (itemObj[itemid]) {
          tellyouTip(tellO['warnReset'], 'suredelitem', itemid);
        } else {
          tellyouTip(tellO['helpReset'], 'tip');
        }
      }

      function showWrapper(ele) {
        var oitemPeriod = ele.parentElement;
        var owrapper = oitemPeriod.querySelector('.itemCon-wrapper');
        if (ele.getAttribute('data-show') === '1') {
          owrapper.classList.add('hidden');
          ele.setAttribute('data-show', '0');
          ele.querySelector('span').classList.add('unshow');
        } else {
          owrapper.className = 'itemCon-wrapper';
          ele.setAttribute('data-show', '1');
          ele.querySelector('span').classList.remove('unshow');
        }
      }
      // 初始化数据
      function origin() {
        if(!localGet('finishObj','object')){ // 单独对象 finishObj
          let o1 = localGet('allDayNum', 'object');
          let o2 = localGet('finishpercent', 'object');
          if(o1 && o2){
            let dd = today.slice(0, -3);
            for(let key in o1){
              if(key.indexOf(dd) === 0 || o1[key]){ // 本月或含值的数据才要
                finishObj[key] = [o1[key], o2[key]];
              }
            }
            // localDel('finishpercent');
            // localDel('allDayNum');
          }
        }else{ // 有值，删除前一天空的数据
          finishObj = localGet('finishObj', 'object');
          let yesterday = countBetweenDay(todayAdd, -1, 'afterdays').replace(/-/g, '\/');
          if(finishObj[yesterday] && !finishObj[yesterday][0]){
            delete finishObj[yesterday];
          }
        }
        if (today in finishObj) { // 有今日完成事件数量时才取值
          n_daytask = finishObj[today][0];
        } else {
          finishObj[today] = [0, '0%'];
          localSave('finishObj', finishObj, 'object');
        }
        
        let originS3 = localGet('collect', 'object');
        if (originS3) {
          datacollectbox = originS3;
        } else {
          localSave('collect', datacollectbox, 'object');
        }
        datacollectshow(datacollectbox, ocollectUl);

        datasolve(beforeData.tmpDolist, dolist);
        var num0 = beforeData.tmpDolist.length;
        thingsNums[0].innerText = num0;

        datasolve(beforeData.tmpDaylist, daylist);
        var num1 = beforeData.tmpDaylist.length;
        thingsNums[1].innerText = num1;
        outOfTime();

        datasolve(beforeData.tmpWaitlist, waitlist);
        var num2 = beforeData.tmpWaitlist.length;
        thingsNums[2].innerText = num2;

        datashow(beforeData.tmpProject, project);
        datashow(beforeData.tmpMaylist, maylist);
        datashow(beforeData.tmpReference, reference);

        datasimpleshow(beforeData.tmpRecycle, recycle);
        datasimpleshow(beforeData.checkList, places[0]);
        datasimpleshow(finishList, places[1], 'simple');
        datasimpleshow(beforeData.summaryList, places[2]);
        changeFinishProgress(num0, num1);
      }


      function refreshfun(index) { // 判断开启否,更新刷新任务内容
        var {
          year,
          month,
          date,
          week
        } = getTime();
        // refreshlist 取数据或初始化->遍历 判断显示内容的逻辑
        var orefreshArr = localGet('refreshlist', 'object');
        var obtns = toGet('.firstCon .refreshbtn', true);
        var owrite = toGet('.write');
        var writebox = owrite.getElementsByClassName('writebox')[0];
        var hasval = false;
        var orefreshpart = toGet('.refreshpart');
        var statetxts = toGet('.refreshpart i', true);
        var refreshUls = toGet('.refreshUl', true);
        var pieces = orefreshpart.getElementsByClassName('piece');
        var titles = orefreshpart.getElementsByClassName('title');
        // debugger
        refreshO = {};
        delRefreshArr = localGet('delRefresh', 'object');
        if (orefreshArr) {
          refreshArr = orefreshArr;
          txtData['dayRefresh'] = refreshArr[0];
          txtData['weekRefresh'] = refreshArr[1];
          txtData['monthRefresh'] = refreshArr[2];
          for (let u = 0; u < 3; u++) {
            if (refreshArr[u] && refreshArr[u].trim()) { // 有内容
              if (refreshArr[3] && refreshArr[3][u]) {
                var key = u + '';
                obtns[u].innerText = '√ ' + obtns[u].getAttribute('data-txt');
                statetxts[u].innerText = ' (已开启)';
                noRefreshNote = false;
                pieces[u].classList.remove('unstart');
                titles[u].classList.remove('unstart');
                refreshO[key] = refreshArr[u].trim();
                refreshToLi(refreshUls[u], 'start', refreshArr[u], u);
              } else {
                obtns[u].innerText = obtns[u].getAttribute('data-txt');
                statetxts[u].innerText = ' (未开启)';
                pieces[u].classList.add('unstart');
                titles[u].classList.add('unstart');
                refreshToLi(refreshUls[u], 'unstart', refreshArr[u], u);
              }

            } else {
              obtns[u].innerText = obtns[u].getAttribute('data-txt');
              statetxts[u].innerText = ' (未开启)';
              pieces[u].classList.add('unstart');
              titles[u].classList.add('unstart');
              refreshUls[u].innerHTML = '';
            }
            if (index && (index - 4) === u) {
              if (refreshArr[3] && refreshArr[3][u]) {
                odorefreshtask.innerText = '关闭任务';
              } else {
                odorefreshtask.innerText = '开启任务';
              }
              if (refreshArr[u] && refreshArr[u].trim()) {
                writebox.value = refreshArr[u].trim();
              } else {
                writebox.value = '';
              }
              writeboxTips.innerText = tipO['refresh'];
            }

          }
          // index = null;
        } else {
          refreshArr[3] = [false, false, false];
        }

        function refreshToLi(obj, type, str, index) {
          var finalstr = '';
          var list = str.split('*');
          var front = '';
          for (let i = 0; i < list.length; i++) {
            if (type === 'unstart') {
              finalstr += '<li class="unstart">' + list[i] + '</li>';
            } else if (type === 'start') {
              let val = list[i].trim().replace(/\n/g, '');
              if (index === 0) {
                front = date + '';
              } else if (index === 1) {
                front = date - week + 1 + '';
              } else if (index === 2) {
                front = month + '';
              }
              if (/toLink/.test(val)) {
                let div = document.createElement('div');
                div.innerHTML = val;
                val = div.innerText;
              }
              if (delRefreshArr[index] && delRefreshArr[index][front]) {
                let temp = delRefreshArr[index][front];
                let moreval1 = '】' + val;
                let moreval2 = '】' + val + '^';
                if (temp.indexOf(moreval1) !== -1 || temp.indexOf(moreval2) !== -1) {
                  // 潘丹值是否在delRefreshArr里
                  finalstr += '<li class="finish">' + list[i] + '</li>';
                } else {
                  finalstr += '<li>' + list[i] + '</li>';
                }
              } else {
                finalstr += '<li>' + list[i] + '</li>';
              }
            }
          }

          obj.innerHTML = finalstr;
        }
      }

      function refreshDetailFun() {
        // 把 refreshO的项进行处理， 配合delRefreshArr,再放进 tmpRefreshA 里。
        var {
          year,
          month,
          date,
          week
        } = getTime();
        var daylist = [];
        var weeklist = [];
        var monthlist = [];
        var temp = [];
        var str = '';
        // var refresh = toGet('.tmpRefreshA');
        delRefreshArr = localGet('delRefresh', 'object') || [];
        if (refreshO['0']) {
          daylist = refreshO['0'].split('*');
          daylist = changeToli(daylist, '【日】');
          temp = temp.concat(daylist);
          str = date + '';
          temp = exceptDel(0, temp, str);
        }
        if (refreshO['1']) {
          weeklist = refreshO['1'].split('*');
          weeklist = changeToli(weeklist, '【周】');
          temp = temp.concat(weeklist);
          str = date - week + 1 + '';
          temp = exceptDel(1, temp, str);
        }
        if (refreshO['2']) {
          monthlist = refreshO['2'].split('*');
          monthlist = changeToli(monthlist, '【月】');
          temp = temp.concat(monthlist);
          str = month + '';
          temp = exceptDel(2, temp, str);
        }

        function changeToli(list, txt) {
          for (var i = 0; i < list.length; i++) {
            list[i] = txt + list[i].trim();
          }
          return list;
        }
        tmpRefreshA = temp;
        let listr = '';
        for (let a = 0; a < temp.length; a++) {
          listr = listr + '<li data-id="' + a + '"><b>' + temp[a] +
            '</b><div class="smallcontrol"><span class="deletebtn line" onclick="refreshFinish(event)">ok</span></div></li>';
        }
        refresh.innerHTML = listr;
      }
      // 存数据 collectSortBox checklist finishlist summarylist


      function exceptDel(index, list, front) {
        // index 分日周月， list当前激活的数组，front删除记录前缀
        var valstr = ''; // 当天完成项
        var templist = [];
        if (delRefreshArr[index]) {
          for (var key in delRefreshArr[index]) {
            // 举例：遍历日/周/月的每个删除记录
            if (key === front) { // 今天拥有ok记录
              valstr = delRefreshArr[index][key];
            }
          }
        }
        if (valstr) {
          for (var i = 0; i < list.length; i++) {
            // 需要解决 删除数据中是找不到含链接的
            let trueVal = '';
            if (/(toLink)+/.test(list[i])) {
              let temp = document.createElement('li');
              temp.innerHTML = list[i];
              trueVal = temp.innerText;
              if (valstr.indexOf(trueVal) === -1) {
                templist.push(list[i]);
              }
              continue;
            }
            if (valstr.indexOf(list[i]) === -1) {
              templist.push(list[i]);
            }
          }
        } else {
          templist = list;
        }
        return templist;
      }


      var oregularUl = toGet('.regularUl');
      var oregularUlPass = toGet('.regularUlPass');
      var opassline = toGet('.passline');

      function regularDetailFun(type) { //展示（加载时 添加时）
        // 还剩多少天标记  是否提醒 增 删  refreshUls[3]
        if (type !== 'newadd') {
          var oregular = localGet('regularObj', 'object');
          regularObj = oregular ? oregular : null;
        }
        if (regularObj) {
          let lis = '';
          let lis2 = '';
          let isjump = false;
          //'<li title="' + date + '">' + constr + '</li>'
          let dcalendar = calendarData['special'] ? calendarData['special'] : {}; // 日历
          let totalN = 0;
          for (let date in regularObj) {
            // 还剩多少天标记  是否提醒 
            if (isjump || date !== 'datestr') {
              let list = regularObj[date];
              let leftday = '';
              let ornot = '';
              let outtime = false;
              let canclick = '';
              let gray = false;
              let time = regexDateOnly.exec(date);
              // log(time, date);
              let d = new Date(time[1], time[2] - 1, time[3]).getTime();
              dcalendar[date] = list.slice(1); // 日历
              if (d >= now) { //未过期
                let left = (d - now) / 86400000;
                leftday = ' <em class="leftday">剩 ' + left + ' 天</em>';
              } else {
                outtime = true;
                canclick = 'disabled';
              }
              if (list[0] && !outtime) {
                ornot = '关闭/开启该日的事项提醒">';
              } else {
                ornot = '开启/关闭该日的事项提醒">';
                gray = true;
              }
              let constr = '<div><i>' + date + '</i>' + leftday + '<span class="noticebtn"' + canclick +
                ' data-status="关" onclick="onTaskMention(event)" title="' + ornot + '</span></div>';
              for (let m = 1; m < list.length; m++) {
                totalN++;
                constr += '<span class="item"><span class="taskitem">' + list[m] +
                  '</span><span class="controlers"><span class="writebtn line" onclick="taskEdit(event)"></span><span class="deletebtn line" onclick="taskDelete(event)">×</span></span></span>';
              }
              if (gray) {
                if (outtime) {
                  lis2 += '<li class="closed" title="' + date + '">' + constr + '</li>';
                } else {
                  lis += '<li class="closed" title="' + date + '">' + constr + '</li>';
                }
              } else {
                lis += '<li title="' + date + '">' + constr + '</li>';
              }
            } else {
              isjump = true;
            }
          }
          txtData['regularNum'] = totalN;
          oregularUl.innerHTML = lis;
          oregularUlPass.innerHTML = lis2;
          if (lis2 === '') {
            opassline.classList.add('hidden');
          } else {
            opassline.classList.remove('hidden');
          }
          calendarData['special'] = dcalendar; // 日历
          localSave('calendar', calendarData, 'object'); // 日历
        }

      }

      var ocountdownTxt = toGet('.countdown');



      function countdownFun(val) {
        var date = val.slice(-10);
        let num = countBetweenDay(date)
        if (num >= 0) {
          ocountdownTxt.className = 'countdown show';
          ocountdownTxt.innerText = '距离' + val.slice(0, -10).trim() + '还有' + num + '天';
        } else {
          ocountdownTxt.innerText = '';
          ocountdownTxt.classList.remove('show');
        }
      }

      function Operate(a, b, separate = null, type = null) {
        // type决定加减，默认为 a-b
        if (separate) { // ①带符号的加减
          let idx1 = a.indexOf(separate);
          let idx2 = b.indexOf(separate);
          let a1 = a.slice(0, idx1);
          let a2 = a.slice(idx1 + separate.length);
          let b1 = b.slice(0, idx2);
          let b2 = b.slice(idx2 + separate.length);
          let ok1 = !isNaN(a1 * 1) && !isNaN(b1 * 1);
          let ok2 = !isNaN(a2 * 1) && !isNaN(b2 * 1);
          // log(a1, a2, b1, b2, ok1, ok2);
          if (type && ok1 && ok2) { // 加法
            return a1 * 1 + b1 * 1 + separate + (a2 * 1 + b2 * 1);
          } else if (ok1 && ok2) { // 减法
            return a1 * 1 - b1 * 1 + separate + (a2 * 1 - b2 * 1);
          } else {
            return 0;
          }
        } else { // ②普通加减
          let ok = !isNaN(a * 1) && !isNaN(b * 1);
          if (type && ok) { // 加法
            return a * 1 + b * 1;
          } else if (ok) { // 减法
            return a * 1 - b * 1;
          } else {
            return 0;
          }
        }

      }

      function isToNotice(type) { // 进行提醒日期的统计（改更新会变，日期会变）
        let noticedate = localGet('noticeDates', 'string');
        let num = userDefined['taskMentionTime'];
        let tmparr = [];

        if (noticedate) {
          noticeDateStr = noticedate;
          let d = now + 86400000 * num;
          let list = noticedate.slice(1).split('^'); // 因为每个日期由前面都加^
          if (type === 'get') {
            regularObj = localGet('regularObj', 'object') ? localGet('regularObj', 'object') : {};
          }

          let datestr = regularObj['datestr'] ? regularObj['datestr'] : '';
          for (let m = 0; m < list.length; m++) {
            let time = regexDateOnly.exec(list[m]);
            let dd = new Date(time[1], time[2] - 1, time[3]).getTime();
            let date = time[0];
            let hasdate = (datestr && datestr.indexOf(date) !== -1) ? true : false;
            if (hasdate && d >= dd && now <= dd) {
              otaskwarn.classList.add('show');
              if (type !== 'get') {
                break;
              }
            } else {
              otaskwarn.classList.remove('show');
              if (!hasdate) { // 日期不存在
                noticeDateStr = noticeDateStr.replace('^' + date, '');
              }
            }
          }
          localSave('noticeDates', noticeDateStr);
        } else {
          otaskwarn.classList.remove('show');
          noticeDateStr = '';
        }
      }

      function saveData(all) {
        let s = [];
        for (let i = 0; i < 7; i++) {
          let key = datalist[i];
          s[i] = beforeData[key].join('$');
          s[i] = s[i].replace(/~/g, ' ');
        }

        let str = s.join('~');
        localSave('collectSortBox', str);
        sortBoxStr = str;
        localSave('summarylist', beforeData.summaryList, 'object');
        // log(beforeData,all);
        if (all) {
          localSave('checklist', beforeData.checkList, 'object');
          localSave('finishlist', finishList, 'object');
        }
      }

      function datashow(list, obj) {
        let str = '';
        existItemArr = ['模板'];
        let num = 1;
        for (let a = 0; a < list.length; a++) {
          let val = list[a].trim();
          if (obj === project) {
            if (val) {
              let decor = ' >';
              let matchsign = /\s@([a-z-_0-9]+)$/g.exec(val);
              if (matchsign && existItemArr.indexOf(matchsign[1]) === -1) {
                let id = matchsign[1];
                decor = ' data-sign="' + id + '"><span class="triangle" onclick="toMainSquare(4, \'' + id +
                  '\')"></span>';
                existItemArr[num] = id;
                num++;
                if (!itemObj[id]) {
                  itemObj[id] = ['项目名', {}, '备注'];
                }
                itemObj[id][0] = val.slice(0, val.lastIndexOf('@')).trim();
              }
              str = str + '<li data-id="' + a + '" ' + decor + '<b class="item">' + val +
                '</b><div class="smallcontrol"><span class="writebtn line" onclick="lineEdit(event)"></span><span class="deletebtn line" onclick="lineDelete(event)">×</span></div></li>';
            }
          } else {
            if (val) {
              str = str + '<li data-id="' + a + '"><b class="item">' + val +
                '</b><div class="smallcontrol"><span class="writebtn line" onclick="lineEdit(event)"></span><span class="deletebtn line" onclick="lineDelete(event)">×</span></div></li>';
            }
          }

        }
        if (obj === project) {
          existItemArr = existItemArr.concat(filedArr);
          localSave('existItem', existItemArr, 'object');
          localSave('itemObj', itemObj, 'object');
        }
        obj.innerHTML = str;
      }

      function datasimpleshow(list, obj, type, pre) {
        // 简单展示 有无前缀，或复杂（删除时类型传入-1，用意在不更新回收站清单数据）
        let str = '';
        let lilength = list.length;
        for (let a = 0; a < lilength; a++) {
          let temp = '';
          if (list[a].trim()) {
            if (type === 'simple' && pre) {
              str = str + '<li>' + pre + ' <b>' + list[a].trim() + '</b></li>';
            } else if (type === 'simple') {
              if (list == finishList) {
                let nowindex = lilength - a - 1;
                let tmmp = list[nowindex].trim();
                if (tmmp.indexOf(today) === 0) {
                  str = str + '<li><b>' + tmmp.slice(10) + '</b></li>';

                } else {
                  if (obj == places[1]) {
                    str = str + '<li class="old"><b>' + tmmp.slice(10) + '</b></li>';
                  } else {
                    str = str + '<li class="old"><b>' + tmmp + '</b></li>';
                  }
                }

              } else {
                str = str + '<li><b>' + list[a].trim() + '</b></li>';
              }
            } else if (type === 'memory') {
              let spanlist = list[a].trim().split('~');
              for (let b = 0; b < spanlist.length; b++) {
                if (b === 0) {
                  temp = temp + '<i>' + spanlist[b].trim().substring(0, 11) + '</i><span>' + spanlist[b].trim()
                    .substring(13) + '</span>';
                } else {
                  temp = temp + '<span>' + spanlist[b].trim() + '</span>';
                }

              }
              str = str + '<li>' + temp + '</li>';
            } else {
              str = str + '<li data-id="' + a + '"><b class="item">' + list[a].trim() +
                '</b><div class="smallcontrol"><span class="writebtn line" onclick="lineEdit(event)"></span>' +
                '<span class="deletebtn line" onclick="lineDelete(event,-1)">×</span></div></li>';
            }
          }
        }
        obj.innerHTML = str;
      }

      var ocollectPnums = toGet('.collectPnum', true);

      function datacollectshow(list, obj) {
        let str = '';
        for (let a = 0; a < list.length; a++) {
          if (list[a].trim()) {
            str = str + '<li data-id="' + a +
              '"><label><input type="checkbox" value=""/><span class="cbox" onclick="ischeckcount(event)"></span></label><b class="item" onclick="turnwriting(event)">' +
              list[a].trim() +
              '</b><span class="deletebtn" onclick="simpleDelete(event, -1)">×</span></li>';
          }
        }
        obj.innerHTML = str;
        ocollectPnums[0].innerText = list.length;
      }

      var ocollectAddbtn = toGet('.collectAddbtn');
      ocollectAddbtn.onclick = function() {
        // let li  = document.createElement('li');
        let idex = ocollectUl.querySelectorAll('b.item').length;
        // let str =  '<label><input type="checkbox" value=""/><span class="cbox" onclick="ischeckcount(event)"></span></label><b class="item" onclick="turnwriting(event)"><input type="text" onblur="finishwriting(event)" onkeydown="anotherwriting(event)" /></b><span class="deletebtn" onclick="simpleDelete(event, -1)">×</span>';
        // li.setAttribute('data-id', idex+'');
        // li.innerHTML = str;
        // ocollectUl.appendChild(li);
        // ocollectUl.lastChild.querySelector('.item input').focus();
        // ocollectUl.scrollIntoView(true);
        let str =
          '<li data-id="0"><label><input type="checkbox" title="点击圆圈选中该项"/><span class="cbox" onclick="ischeckcount(event)"></span></label><b class="item" onclick="turnwriting(event)"><input type="text" title="收集箱里的事项输入" onblur="finishwriting(event)" onkeydown="anotherwriting(event)" /></b><span class="deletebtn" onclick="simpleDelete(event, -1)">×</span></li>';
        let lis = str + ocollectUl.innerHTML;
        ocollectUl.innerHTML = lis;
        ocollectPnums[0].innerText = idex + 1;
        let ochecklis = ocollectUl.querySelectorAll('li.checked');
        let length = ochecklis.length;
        for (let item = 0; item < length; item++) {
          ochecklis[item].querySelector('input').checked = true;
        }
        ocollectUl.firstChild.querySelector('.item input').focus();
      }
      otagstatus.onclick = function(e) {
        let ele = e.target || e.srcElement;
        if (ele.tagName === 'B') {
          ele = ele.querySelector('span');
        }
        if (ele.tagName === 'SPAN') {
          let val = ele.innerText;
          let finalfind = '';
          if (val !== '#全部' && val !== '#今天' && val !== '#记忆' && val !== '本本' && val !== '收藏' && val !==
            '搜索记录') {
            for (let ii = 0; ii < tagArr.length; ii++) {
              if (tagArr[ii].indexOf(val)) {
                if (/[|]+/.test(tagArr[ii])) {
                  let index = tagArr[ii].indexOf('|');
                  finalfind = val.slice(0, index);
                } else {
                  finalfind = val;
                }
                break;
              }
            }
          } else {
            finalfind = val;
          }
          tosearchtag(val);
        }
      }
      var otagmenudecor = toGet('.tagmenudecor');
      otagmenudecor.onclick = function() {
        toMainSquare(numOfSection);
        if (n_newpartshow === 3) { // 帮助页已打开
          var olis = obookmenu.getElementsByTagName('li');
          olis[txtpartshow].classList.remove('active');
          txtparts[txtpartshow].classList.remove('active');
          olis[3].classList.add('active');
          txtparts[3].classList.add('active');
          txtpartshow = 3;
          window.scrollTo(0, 0);
        } else {
          toNewpart(3, 'review', 3);
        }
      }
      var otagmenujumpline = document.querySelectorAll('.tagmenujumpline u');
      var otodayDakaTxt = toGet('.todayDakaTxt');
      var osignInBtn = toGet('.signInBtn');
      var ojumpdakabtn = toGet('.jumpdakabtn');
      otodayDakaTxt.onclick = jumptoDakaFun;
      osignInBtn.onclick = jumptoDakaFun;
      ojumpdakabtn.onclick = jumptoDakaFun;
      otagmenujumpline[0].onclick = jumptoDakaFun;
      otagmenujumpline[1].onclick = function() {
        toMainSquare(1);
        showTaskContent();
      }

      function jumptoDakaFun() {
        // if (n_newpartshow !== 1) {
        //   toNewpart(1);
        // }
        var oSliBox1 = toGet('.slideBox');
        var nowState = oSliBox1.classList.contains('active');
        if (!nowState) {
          toggleDaka('slideBox');
        }
        // 柱形图
        // var oSliBox2 = toGet('.dayCheck');
        // var ulState = oSliBox2.classList.contains('active');
        // if (!ulState) {
        //   toggleDaka('chart', 'dayCheck');
        // }
        // window.scroll(0, 0);
      }

      function datatagsolve(val = '', type = 'txt') {
        let list0 = [];
        let list1 = [];
        let list2 = [];
        let list3 = [];
        let datacollect = datacollectbox.map((item) => '「集」 ' + item);
        if (val && datacollect.length !== 0) {
          list0 = searchOutOne(datacollect, val);
        } else {
          list0 = datacollect;
        }
        if (type === 'today') {
          list0 = [];
          var refreshUnfinish = tmpRefreshA.join('^');
        }
        let datado = beforeData['tmpDolist'].map((item) => '「执」 ' + item);
        let dataday = beforeData['tmpDaylist'].map((item) => '「历」 ' + item);
        let datawait = beforeData['tmpWaitlist'].map((item) => '「等」 ' + item);
        let datapro = beforeData['tmpProject'].map((item) => '「项」 ' + item);
        let datamaybe = beforeData['tmpMaylist'].map((item) => '「可」 ' + item);
        let fivelist = datado.concat(dataday, datawait, datapro, datamaybe);
        if (val && fivelist.length !== 0 && type !== 'today') {
          list0 = list0.concat(searchOutOne(fivelist, val));
        } else {
          list0 = list0.concat(fivelist);
        }
        let datadaka = [];
        let upperval = val.toUpperCase();
        if (dakaData[upperval] && dakaData[upperval][0] != 0) {
          let t = dakaData[upperval].join(' ');
          t = t.replace(' ', '次，( ');
          let tt = '「打卡」【<span>' + upperval + '</span>】 打卡' + t + ' )';
          datadaka.push(tt);
        } else if (regexOnlyDate.test(val)) {
          let dakadateObj = localGet('dakadateObj', 'object');
          if (dakadateObj) {
            for (let dakadate in dakadateObj) {
              if (dakadate === val) {
                let dakaVal = dakadateObj[dakadate];
                let ttt = '';
                if (type === 'today') {
                  ttt = '今天打卡了<span>' + dakaVal + '</span>';
                } else {
                  ttt = dakadate + ' 打卡了 ' + dakaVal;
                }
                ttt = ttt + ' （目前共打卡<span>' + dakaData[dakaVal][0] + '</span>次）';
                datadaka.push(ttt);
                break;
              }

            }
          }
        }
        let datafinish = finishList.map((item) => '[完] ' + item);
        let datanote = beforeData.summaryList.map((item) => '「本本」 ' + item);
        let memoryli = [];
        if (omemory.origin) {
          for (let key in omemory) {
            if (key !== 'origin' && /~/.test(omemory[key])) {
              let mm = omemory[key].split('~');
              let finalmm = '';
              let mmcount = 0;
              for (let ii = 0; ii < mm.length; ii++) {
                if (mm[ii].indexOf(val) !== -1 || (type === 'date' && key === val)) {
                  mmcount++;
                  if (mmcount > 1 && type === 'txt') {
                    finalmm += '<p>' + mm[ii].replace(val, '<span>' + val + '</span>') + '</p>';
                  } else {
                    finalmm += '<p>' + mm[ii] + '</p>';
                  }
                }
              }
              memoryli[memoryli.length] = key + ' ' + finalmm;
            } else if (key !== 'origin') {
              memoryli[memoryli.length] = key + ': ' + omemory[key];
            }
          }
        }
        // 把进程数据做成一项 （
        let datamemory = memoryli.map((item) => '「记忆」' + item);
        let fortaglist = showNote('无', 'tagsolve');
        let dataanalyse = fortaglist.reverse().map((item) => '「分析」 ' + item);
        let donelist = [];
        if (type === 'justmemory') {
          donelist = list1.concat(datamemory);
        } else if (type === 'today') {
          // 加上进度  
          let progressTxt = '<span>' + progressSim.innerText + '</span>';
          let datafinishToday = [progressTxt];
          for (let finn = 0; finn < finishList.length; finn++) {
            if (finishList[finn].indexOf(val) !== -1) {
              let finnval = finishList[finn];
              datafinishToday.push('[完] ' + finnval.slice(11));
            }
          }
          donelist = list1.concat(datadaka, datafinishToday);
        } else {
          donelist = list1.concat(datamemory, dataanalyse, datadaka, datafinish, datanote);
        }
        if (val && donelist.length !== 0 && type !== 'today') {
          list1 = searchOutOne(donelist, val);
        } else {
          list1 = donelist;
        }
        let refreshli = [];
        let refreshliToday = [];
        if (refreshArr) {
          let reftxt = ['「日刷」', '「周刷」', '「月刷」'];
          for (let ire = 0; ire < 3; ire++) {
            if (refreshArr[ire]) {
              let finalref = '';
              let tmpref = [];
              let isstart = refreshArr[3][ire];
              if (/\*/.test(refreshArr[ire])) {
                tmpref = refreshArr[ire].split('*');
                let rrecount = 0;
                for (let rrr = 0; rrr < tmpref.length; rrr++) {
                  if (tmpref[rrr].indexOf(val) !== -1 || (type === 'today' && isstart)) {
                    rrecount++;
                    if (rrecount > 1 && type === 'txt') {
                      finalref += '<p>' + tmpref[rrr].replace(val, '<span>' + val + '</span>') + '</p>';
                    } else if (type === 'today') {
                      if (refreshUnfinish.indexOf(tmpref[rrr]) !== -1) {
                        finalref += '<p>' + tmpref[rrr] + '</p>';
                      }
                    } else {
                      finalref += '<p>' + tmpref[rrr] + '</p>';
                    }
                  }

                }
              } else {
                if (refreshArr[ire].indexOf(val) !== -1 || (type === 'today' && isstart && (refreshUnfinish
                    .indexOf(
                      refreshArr[ire]) !== -1))) {
                  finalref = refreshArr[ire];
                }
              }

              if (!(type === 'today' && !isstart)) {
                refreshli[refreshli.length] = reftxt[ire] + ' ' + finalref;
              }
            }
          }
        }
        let datarefresh = refreshli;
        let regularli = [];
        if (regularObj) {
          for (let datekey in regularObj) {
            if (datekey !== 'datestr') {
              let dateitemli = regularObj[datekey];
              let finaldd = '';
              if (dateitemli.length === 2) {
                finaldd = dateitemli[1];
              } else {
                let regucount = 0;
                for (let dd = 1; dd < dateitemli.length; dd++) {
                  if (dateitemli[dd].indexOf(val) !== -1 || (type === 'date' && datekey === val)) {
                    regucount++;
                    if (regucount > 1 && type === 'txt') {
                      finaldd += '<p>' + dateitemli[dd].replace(val, '<span>' + val + '</span>') + '</p>';
                    } else {
                      finaldd += '<p>' + dateitemli[dd] + '</p>';
                    }
                  }
                }

              }
              regularli[regularli.length] = datekey + ' ' + finaldd;

            }
          }
        }
        let dataregular = regularli.map((item) => '「定期」 ' + item);
        let datahotlink = linkArr.map((item) => '「链接」 ' + item);
        let datarefer = beforeData['tmpReference'].map((item) => '「参考」 ' + item);
        let datacheck = beforeData.checkList.map((item) => '「检查」 ' + item);
        let tasklist = [];
        if (type !== 'today') {
          tasklist = list2.concat(datarefresh, dataregular, datahotlink, datarefer, datacheck);
        } else {
          tasklist = list2.concat(datarefresh);
        }
        if (val && tasklist.length !== 0 && type !== 'today') {
          list2 = searchOutOne(tasklist, val);
        } else {
          list2 = tasklist;
        }
        let datadel = beforeData['tmpRecycle'].map((item) => '[删] ' + item);
        if (val && datadel.length !== 0) {
          list3 = searchOutOne(datadel, val);
        } else {
          list3 = datadel;
        }
        if (type === 'justmemory') {
          list0 = [];
          list2 = [];
          list3 = [];
        }
        if (type === 'date' && val === todayAdd) {
          list0 = [];
        }

        return [list0, list1, list2, list3];
      }

      var odownloadnowbtn = toGet('.downloadnowbtn');
      let otagDownload = toGet('.tagDownload');
      let otagDownCon = toGet('.tagDownCon');
      let otagdownBtns = toGet('.tagdownBtn', true);
      let otagcontrolline = toGet('.tagsection .control');
      const otagContent = toGet('.tagContent');
      odownloadnowbtn.onclick = isTagEditshow;
      otagdownBtns[2].onclick = isTagEditshow; // 取消-关闭
      function isTagEditshow() {
        if (odownloadnowbtn.innerText === '编辑模式') {
          odownloadnowbtn.innerText = '查看模式';
          otagDownload.classList.add('active');
          otagcontrolline.classList.add('active');
          otagContent.classList.add('active');
          otagDownCon.innerText = tagdownloadEdit();
        } else {
          odownloadnowbtn.innerText = '编辑模式';
          otagDownload.classList.remove('active');
          otagcontrolline.classList.remove('active');
          otagContent.classList.remove('active');
        }
        tojumptagmenu('0'); // 回到首部
      }

      function tagdownloadEdit() {
        var ooodownloadlist = [];
        var lis = otagContent.querySelectorAll('li');
        for (let i = 0; i < lis.length; i++) {
          // 先处理链接，再处理p span
          let tmpval = lis[i].innerHTML;
          let tmp = tmpval;
          if (tmpval.indexOf('「分析」') === 0) {
            let analys = lis[i].querySelectorAll('p');
            tmp = lis[i].firstChild.nodeValue + '\n- ';
            tmp = tmp + analys[0].innerHTML + '\n- 遇到的困难：' + analys[1].innerHTML + '\n- 打算：' + analys[2]
              .innerHTML;
            tmp = tmp.replace('<u>', '');
            tmp = tmp.replace('</u>', '');
          } else if (/<p>/.test(tmpval)) {
            let pps = lis[i].querySelectorAll('p');
            let content = [];
            for (let item = 0; item < pps.length; item++) {
              content[item] = pps[item].innerHTML;
            }
            tmp = lis[i].firstChild.nodeValue + '\n- ' + content.join('\n- ');
          }
          if (/toLink/.test(tmpval)) {
            tmp = linkSolved(tmp, 'linktoMd');
          }

          ooodownloadlist[i] = tmp;
        }
        let ooodownstr = ooodownloadlist.join('\n- ');
        ooodownstr = ooodownstr.replace(/<span>/g, '');
        ooodownstr = ooodownstr.replace(/<\/span>/g, '');
        ooodownstr = '> Doit标签结果 ' + todayAdd + '  \n  \n- ' + ooodownstr;
        return ooodownstr;
      }
      otagdownBtns[0].onclick = function() { // 去掉标志
        let str = otagDownCon.innerText;
        str = str.replace(/「[\u4e00-\u9fa5]{1,2}」/g, '');
        otagDownCon.innerText = str;
      }
      otagdownBtns[1].onclick = function() { // 下载标签内容
        let str = otagDownCon.innerText;
        let filename = todayAdd + '(Doit-Tag).md';
        download(filename, str, 'text/markdown');
      }

      function searchOutOne(list, val) {
        let newlist = [];
        for (let i = 0; i < list.length; i++) {
          if (/^\[打卡\]/.test(list[i])) {
            let tmmp = list[i].replace('[打卡]', '');
            newlist.push(tmmp);
          } else if (list[i].indexOf(val) !== -1) {
            let tmp = list[i].replace(val, '<span>' + val + '</span>');
            newlist.push(tmp);
          }
        }
        return newlist;
      }

      function isDate(intYear, intMonth, intDay) {
        if (isNaN(intYear) || isNaN(intMonth) || isNaN(intDay)) return false;
        if (intMonth > 12 || intMonth < 1) return false;
        if (intDay < 1 || intDay > 31) return false;
        if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intDay > 30)) return false;
        if (intMonth == 2) {
          if (intDay > 29) return false;
          if ((((intYear % 100 == 0) && (intYear % 400 != 0)) || (intYear % 4 != 0)) && (intDay > 28))
            return false;
        }
        return true;
      }

      function datasolve(list, obj) {
        let real = [];
        list.map((item, index) => {
          let temp = '';
          if (item.indexOf('@急') !== -1) {
            temp += '<u class="hurry" title="紧急"></u>';
          }
          if (item.indexOf('@重') !== -1) {
            temp += '<u class="significant" title="重要"></u>';
          }
          // 对日期进行判断  还剩多少天
          let leftday = '';
          item = item.trim();
          if (obj == daylist && regexDate.test(item) && !/toLink/.test(item)) {
            let time = regexDate.exec(item);
            let d = new Date(time[1], time[2] - 1, time[3]).getTime();
            let ttday = new Date(d);
            // log(d, time[0], ttday, (d - now) / 86400000);
            if (d >= now && isDate(time[1], time[2], time[3])) { //未过期
              let left = (d - now) / 86400000;
              leftday = ' <em class="leftday">剩 ' + left + ' 天</em>';
            }
          }
          let li = '<li data-id="' + index +
            '"><label><input type="checkbox" value=""/><span class="cbox" onclick="checkIt(event)"></span><span class="sortNumSign"></span>' +
            temp +
            '<b class="item"  onclick="checkIt(event)">' + item + leftday +
            '</b></label><div class="smallcontrol"><span class="writebtn line" onclick="lineEdit(event)" title="修改"></span>' +
            '<span class="deletebtn line" onclick="lineDelete(event)" title="删除">×</span>' +
            '<span class="numberbtn line" onclick="beNumSort(event)" title="排序1">1</span>' +
            '<span class="numberbtn line" onclick="beNumSort(event)" title="排序2">2</span>' +
            '<span class="numberbtn line" onclick="beNumSort(event)" title="排序3">3</span>' +
            '<span class="numberbtn line" onclick="beNumSort(event)" title="排序4">4</span></div></li>';
          real.push(li);
        });

        // log('datasolve创建了li', list);
        let realStr = real.join('');
        obj.innerHTML = realStr;
      }

      function outOfTime() {
        let lis = daylist.querySelectorAll('b');
        for (let i = 0; i < lis.length; i++) {
          let item = lis[i].innerText;
          if (regexDate.test(item)) {
            let time = regexDate.exec(item);
            let d = new Date(time[1], time[2] - 1, time[3]).getTime();
            if (d < now) { //逾期了
              lis[i].classList.add('overtime');
            } else if (lis[i].classList.contains('overtime')) {
              lis[i].classList.remove('overtime');
            }
          }
        }
      }



      function sortFirst(num) {
        if (num === 0) {
          tosort(dolist, 'tmpDolist');

        } else if (num === 1) {
          tosort(daylist, 'tmpDaylist');
        } else {
          tosort(waitlist, 'tmpWaitlist');
        }
        solvedBtns[num].setAttribute('data-num', 0);
        solvedBtns[num].classList.remove('active');
        sortBtns[num].classList.remove('active');
      }

      function tosort(list, name) {
        // 优先序 按照data-sort的值排序 从小到大排序
        var lis = list.querySelectorAll('li');
        var idNumberlist = new Map();
        var idValue = new Map();
        var leftlist = [];
        var pointlist = [];
        for (var i = 0; i < lis.length; i++) {
          var id = lis[i].getAttribute('data-id');
          var val = lis[i].querySelector('b.item').innerHTML;
          if (name === 'tmpDaylist' && /剩\s[0-9]+\s天/.test(val)) {
            let tempval = lis[i].querySelector('b.item').innerText;
            let tempindex = /(?<=)剩\s[0-9]+\s天/.exec(tempval).index;
            val = val.slice(0, tempindex).trim();

          }
          if (lis[i].getAttribute('data-sort')) {
            var number = lis[i].getAttribute('data-sort');
            idNumberlist.set(id, number);
            idValue.set(id, val);
          } else {
            leftlist.push(val);
          }
        }
        for (var j = 0; j < 4; j++) {
          for (let [i, num] of idNumberlist) {
            if (num == j) {
              pointlist.push(idValue.get(i));
            }
          }
        }
        beforeData[name] = pointlist.concat(leftlist);
        datasolve(beforeData[name], list);
        if (name === 'tmpDaylist') {
          outOfTime();
        }
        // log(name,list,beforeData[name]);
        saveData();
      }

      function uniqueSort(parent, one, num) {
        var btn = parent.getElementsByClassName('sortNumSign')[0];
        btn.classList.add('active');
        btn.innerText = num;
      }

      function beNumSort(event) {
        var parent = event.target.parentElement.parentElement;
        var snum = event.target.innerText;
        var dnum = snum * 1 - 1;
        var sortBtn = parent.parentElement.parentElement.parentElement.querySelector('.sortBtn');
        sortBtn.classList.add('active');
        uniqueSort(parent, dnum, snum);
        parent.setAttribute('data-sort', dnum);
      }


      function sortIt(type = 'add') {
        // 日期升序 清单里的
        let list = beforeData.tmpDaylist;
        let len = list.length;
        let unsure = [];
        let sortList = [];
        let ids = [];
        let m = new Map();
        let s = new Set();
        // let outOfList = [];
        for (let i = 0; i < len; i++) {
          let item = list[i].trim();
          if (regexDate.test(item)) {
            let time = regexDate.exec(item);
            let d = new Date(time[1], time[2] - 1, time[3]).getTime();
            m.set(i, d);
            s.add(d);
          } else {
            // 没日期
            unsure.push(i);
          }
        }
        let arr = [...s];
        arr.sort();
        for (let j of arr) {
          for (let [k, v] of m) {
            if (v === j) {
              ids.push(k);
            }
          }
        }
        let index = 0;
        let unindex = 0;
        for (let u = 0; u < len; u++) {
          if (index < ids.length) {
            let id = ids[index];
            sortList[u] = list[id];
            index++;
          } else {
            let unsureId = unsure[unindex];
            sortList[u] = list[unsureId];
            unindex++;
          }
        }
        // log(sortList);
        beforeData.tmpDaylist = sortList;
        saveData();
        datasolve(sortList, daylist);
        outOfTime();
        solvedBtns[1].setAttribute('data-num', 0);
        solvedBtns[1].classList.remove('active');
        sortBtns[1].classList.remove('active');
        // thingsNums[1].innerText = len;
      }

      function checkIt(event) {
        // event.stopPropagation(); // IE则是使用e.cancelBubble = true
        // event.cancelBubble = true;
        // debugger
        let label = event.target.parentElement;
        if (label.tagName !== 'LABEL') { // 多了剩余几天的标签，需要调整
          label = label.parentElement;
        }
        const input = label.getElementsByTagName('input')[0];
        const b = label.querySelector('b.item');
        const part = label.parentElement.parentElement.parentElement.parentElement;
        const solvedBtn = part.querySelector('.solvedBtn');
        let num = solvedBtn.getAttribute('data-num') ? solvedBtn.getAttribute('data-num') * 1 : 0;
        // log(input.attributes.checked);// 首次 undefined
        if (input.checked) {
          num--;
          input.attributes.checked = false;
          b.classList.remove('finish');
          label.classList.remove('finish');
        } else {
          // 第一次或者没有选中的时候
          num++;
          input.attributes.checked = true;
          b.classList.add('finish');
          label.classList.add('finish');
        }
        solvedBtn.setAttribute('data-num', num);
        if (num > 0) {
          solvedBtn.classList.add('active');
        } else {
          solvedBtn.classList.remove('active');
        }
      }

      var tmpValue = null;
      var tmpNode = null;
      var tmpTaskDate = null; // 作为前后修改日期的对比和原样修改的标志
      var tmpOldtask = null; // 用来记录task修改前的值
      var isNowALink = false;

      function isSaveItem(val = '', obj) {
        // debugger
        var item = val;
        var isleftday = false;
        if (obj) {
          item = obj.innerHTML;
          if (/剩\s[0-9]+\s天/.test(item)) {
            let tempval = obj.innerText;
            let tempindex = /(?<=)剩\s[0-9]+\s天/.exec(tempval).index;
            item = item.slice(0, tempindex);
            isleftday = true;
          }
        }
        if (item) {
          item = item.replace(/javascript/gi, 'javascript');
          item = item.replace(/&quot;/g, '"');
          if (!(/javascript(?=\:)+/.test(item)) &&
            (/^<b[\s]+class[\s]*=[\s]*\"link\"[\s]+onclick[\s]*=[\s]*[\"\']?toLink.+<\/b>$/.test(item) ||
              /^[^\<\>]+<b[\s]+class[\s]*=[\s]*\"link\"[\s]+onclick[\s]*=[\s]*[\"\']?toLink.+<\/b>[^\<\>]+$/.test(
                item))) {
            let regex1 = /((https?|http):\/\/[-A-Za-z0-9%@#&+/?=~_|!:;,.]+[-A-Za-z0-9+&@#/%=~_|])/g;
            let regex2 = /((https?|http):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|])/g;
            let regex3 = /(http\S+)\)/g;
            let islink = regex1.exec(item) || regex2.exec(item) || regex3.exec(item);
            if (islink) {
              isNowALink = true;
            } else {
              isNowALink = false;
            }
            return item.trim();

          } else if (/javascript(?=\:)+/.test(item) || /\<[a-z]+\>.*\<\/[a-z]+\>/.test(item)) { // 非法标签和代码
            isNowALink = false;
            return false;
          } else if (obj) {
            isNowALink = false;
            if (isleftday) {
              return item.trim();
            } else {
              return obj.innerText.trim();
            }
          } else {
            isNowALink = false;
            return item.trim();
          }
        }
      }

      var tempcheckcountnum = 0;

      function ischeckcount(event) {
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'SPAN') {
          let newnum = 0;
          let label = ele.parentElement;
          let input = label.querySelector('input');
          if (input.checked) {
            tempcheckcountnum--;
            label.parentElement.className = '';
          } else {
            tempcheckcountnum++;
            label.parentElement.className = 'checked';
          }
          ocollectPnums[1].innerHTML = tempcheckcountnum;
        }
      }

      function turnwriting(event) {
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'B') {
          ele.contentEditable = true;
        }
      }

      function finishwriting(event) {
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'INPUT') {
          var value = ele.value;
          var oli = ele.parentElement.parentElement;
          if (value.trim()) {
            var val = isSaveItem(value, null);
            if (val) {
              ele.parentElement.innerHTML = val;
            } else {
              ocollectUl.removeChild(oli);
            }
          } else {
            ocollectUl.removeChild(oli);
          }
          let idx = ocollectUl.querySelectorAll('b.item').length;
          ocollectPnums[0].innerText = idx;
        }
      }

      function anotherwriting(event) {
        var e = event || window.event;
        var ele = e.target || e.srcElement;
        var keycode = e.keyCode || e.which;
        if (ele.tagName === 'INPUT' && keycode == 13) {
          ele.blur();
        }
      }

      function lineEdit(event) { // 打开书写框 改样式 writebox.value获取值和改值对象tmpNode
        // debugger
        const li = event.target.parentElement.parentElement;
        const b = li.getElementsByClassName('item')[0];
        b.classList.add('chosed');
        //  点击修改之后，弹出书写框 获取内容 修改项高亮显示

        var val = isSaveItem(null, b);
        val = val.replace(/&quot;/g, '"');
        // if (isNowALink) {

        // }
        tmpValue = val;
        if (!li.parentElement.classList.contains('tmpProject')) {
          menuBtns[6].classList.remove('edit');
          menuBtns[6].classList.add('active');
        }
        owrite.style.display = 'block';
        writebox.focus();
        menuBtns[1].setAttribute('data-open', '1');
        // const submitBtn = owrite.getElementsByClassName('circlebtn')[2];
        menuBtns[5].innerText = '确定修改';
        menuBtns[5].title = '仅是单个值修改，修改效果是临时的(快捷键Alt+Enter)'
        menuBtns[5].classList.add('active');
        tmpNode = b;
        solveUl = li.parentElement;
        changeId = li.getAttribute('data-id');
        writebox.value = val;
        writeboxTips.innerText = tipO['edit'];
      }

      function lineDelete(event, type = 'complex') { // 删除值 写在tmpRecycle列表上 改样式 writebox.value获取值和改值对象tmpNode
        let li = event.target.parentElement.parentElement;
        if (li.nodeName !== 'LI') {
          li = li.parentElement;
        }
        let ul = li.parentElement;
        let index = li.getAttribute('data-id');
        ul.removeChild(li);

        if (type === 'complex') {
          const val = li.querySelector('b.item').innerText;
          beforeData['tmpRecycle'].unshift(val);
          // beforeData.tmpRecycle[beforeData.tmpRecycle.length] = val;
          datasimpleshow(beforeData.tmpRecycle, recycle);
        }

        let classname = ul.getAttribute('class');
        findList(classname);
        let list = getList(solveUl);
        beforeData[nowlistStr] = list;
        // log(list);
        saveData(1);
        if (nowlistStr === 'tmpDolist' || nowlistStr === 'tmpDaylist' || nowlistStr === 'tmpWaitlist') {
          // datasolve(list, solveUl);
          changeFinishProgress();
          getNum(list);
          if (nowlistStr === 'tmpDaylist') {
            outOfTime();
          }
          if (nowlistStr === 'tmpDolist') {
            localSave('dolist', list.join('*'));
          }
        } else if (nowlistStr === 'tmpProject' || nowlistStr === 'tmpMaylist' || nowlistStr === 'tmpReference') {
          // datashow(list, solveUl);
        } else {
          // datasimpleshow(list, solveUl);
        }
      }

      function simpleDelete(event, type = 'url') {
        let li = event.target.parentElement;
        let obj = li.parentElement; // olinkReference
        obj.removeChild(li);
        let len = obj.querySelectorAll('li').length;
        if (type == '-1') {
          datacollectSave();
          // 进垃圾箱
          let item = li.querySelector('b.item').innerText;
          beforeData['tmpRecycle'].unshift(item);
          datasimpleshow(beforeData.tmpRecycle, recycle);
          saveData();
        } else if (len === 0 && type == 'url') {
          obj.style.display = 'none';
        }
      }

      function taskEdit(event) {
        const oitem = event.target.parentElement.parentElement;
        // 记录日期和内容，方便替换 
        tmpNode = oitem;
        tmpOldtask = oitem.children[0].innerText;
        let taskDate = oitem.parentElement.title;
        var val = tmpOldtask + ' ' + taskDate;
        writeLayer('定期任务');
        writebox.value = val;
        writeboxTips.innerText = tipO['editRegular'];
        orefreshbtn.innerText = '确定定期任务';
      }

      function taskDelete(event, type = 'del') {
        // 把数据取出来删掉存进去，把显示部分删掉
        var oitem = null;
        if (type === 'del') {
          oitem = event.target.parentElement.parentElement;
        } else {
          oitem = tmpNode;
          tmpNode = null;
        }
        var li = oitem.parentElement;
        var length = li.getElementsByClassName('item').length;
        var val = oitem.children[0].innerText;
        var date = li.title;
        regularObj = localGet('regularObj', 'object');
        let dcalendar = calendarData['special'] ? calendarData['special'] : {}; // 日历
        if (regularObj[date]) {
          if (length > 1) { // 现在有2项以上
            let tmplist = [regularObj[date][0]];
            let str = regularObj[date].slice(1).join('^');
            str = '^' + str;
            str = str.replace('^' + val, '');
            regularObj[date] = [...tmplist, ...str.slice(1).split('^')];
            dcalendar[date] = [...str.slice(1).split('^')]; // 日历
            li.removeChild(oitem);
          } else { // 只有一项
            delete regularObj[date];
            delete dcalendar[date]; // 日历
            regularObj['datestr'] = regularObj['datestr'].replace('^' + date, '');
            if (type === 'del') { // 新增项默认是开启提醒的，添加那时会检测
              noticeDateStr = localGet('noticeDates', 'string');
              if (noticeDateStr != '' && noticeDateStr.indexOf(date) !== -1) {
                noticeDateStr = noticeDateStr.replace('^' + date, '');
                localSave('noticeDates', noticeDateStr);
                isToNotice();
              }
            }

            let oul = li.parentElement;
            oul.removeChild(li);
            let lilength = oul.querySelectorAll('li').length;
            if (oul.className === 'regularUlPass' && lilength === 0) {
              opassline.classList.add('hidden');
            }
          }
          txtData['regularNum'] = txtData['regularNum'] - 1;
          localSave('regularObj', regularObj, 'object');
          calendarData['special'] = dcalendar; // 日历
          localSave('calendar', calendarData, 'object'); // 日历
        }
      }

      function onTaskMention(event) { // 按钮开关 和 呈现的变化
        const ele = event.target || event.srcElement;
        const i = ele.parentElement.children[0];
        const li = ele.parentElement.parentElement;
        var date = i.innerText;
        var dateCon = '^' + date;
        let isadd = false;
        let regularObj = localGet('regularObj', 'object');
        if (regularObj && regularObj[date]) {
          if (ele.getAttribute('data-status') === '关') {
            ele.setAttribute('data-status', '开');
            li.classList.add('closed');
            regularObj[date][0] = false;
          } else {
            ele.setAttribute('data-status', '关');
            li.classList.remove('closed');
            regularObj[date][0] = true;
            isadd = true;
          }
          let noticedate = localGet('noticeDates', 'string');
          if (noticedate) {
            noticeDateStr = noticedate;
            if (isadd && noticeDateStr.indexOf(dateCon) === -1) {
              noticeDateStr += dateCon;
            } else if (!isadd) {
              noticeDateStr = noticeDateStr.replace(dateCon, '');
            }
          } else if (isadd) { // 内存中无提醒项的添加
            noticeDateStr = dateCon;
          }
          localSave('noticeDates', noticeDateStr);
          localSave('regularObj', regularObj, 'object');
          isToNotice();
        }
      }

      function refreshFinish(event) {
        //  完成之后存进  && 放进完成清单中
        var {
          year,
          month,
          date,
          week
        } = getTime();
        let oli = event.target.parentElement.parentElement;
        let val = oli.getElementsByTagName('b')[0].innerText;
        // let index = oli.getAttribute('data-id');
        delRefreshArr = localGet('delRefresh', 'object') || [];
        tellyouTip('✔ 完成刷新任务 (同步在习惯日历：需前置#，用+分隔标签与场景)\n\n' + val, 'okRefresh', oli);

      }

      function findList(name) {
        if (/tmpDolist/.test(name)) {
          nowlistStr = 'tmpDolist';
          solveUl = dolist;
        } else if (/tmpDaylist/.test(name)) {
          nowlistStr = 'tmpDaylist';
          solveUl = daylist;
        } else if (/tmpWaitlist/.test(name)) {
          nowlistStr = 'tmpWaitlist';
          solveUl = waitlist;
        } else if (/tmpProject/.test(name)) {
          nowlistStr = 'tmpProject';
          solveUl = project;
        } else if (/tmpMaylist/.test(name)) {
          nowlistStr = 'tmpMaylist';
          solveUl = maylist;
        } else if (/tmpReference/.test(name)) {
          nowlistStr = 'tmpReference';
          solveUl = reference;
        } else if (/tmpRecycle/.test(name)) {
          nowlistStr = 'tmpRecycle';
          solveUl = recycle;
        } else if (/checkList/.test(name)) {
          nowlistStr = 'checkList';
          solveUl = places[0];
        } else if (/summaryList/.test(name)) {
          nowlistStr = 'summaryList';
          solveUl = places[2];
        } else if (/collectUl/.test(name)) {
          nowlistStr = 'collectUl';
          solveUl = ocollectUl;
        }
        // log(nowlistStr, solveUl);
      }

      function ableToEdit(ele, num = 0) {
        // 适用于各个笔头开启功能按钮：主编辑页5 侧边页1 总结页2 标签管理的标签1 共9个
        let tar = ele.parentNode.parentNode;

        if (num === -1) {
          tar = tar.parentNode;
        }
        if (num === -5) { // tag
          tar = ele.parentNode;
        }
        let classname = tar.getAttribute('class');
        if (/noEdit/.test(classname)) {
          tar.classList.remove('noEdit');
          ele.setAttribute('data-now', 'on');
        } else {
          tar.classList.add('noEdit');
          ele.setAttribute('data-now', 'off');
        }
      }

      //  处理 添加按钮的实现 数据处理
      var ocontent = toGet('.mainpart');
      var parts = ocontent.getElementsByClassName('part');
      var oheaders = ocontent.getElementsByClassName('header');
      var solvedBtns = ocontent.querySelectorAll('.solvedBtn'); // 3个处理按钮
      var sortBtns = ocontent.querySelectorAll('.sortBtn'); // 3个优先序按钮

      function getDatelist() {
        getTime();
        var list = [];
        var old = localGet('finishdate', 'object');
        if (old) {
          if (old[old.length - 1] !== today) {
            list = old;
            list[old.length] = today;
            localSave('finishdate', list, 'object');
          }
        } else {
          list[0] = today;
          localSave('finishdate', list, 'object');
        }
      }

      function fixit(index, list, listname) {
        getDatelist(); // 获取完成清单的日期
        var num = list.length;
        thingsNums[index].innerText = num;
        datasolve(list, listname);
        changeFinishProgress(); // 算进度
        saveData(1);
        solvedBtns[index].setAttribute('data-num', 0);
        solvedBtns[index].classList.remove('active');
        sortBtns[index].classList.remove('active');
      }

      solvedBtns[0].onclick = function() {
        beforeData.tmpDolist = solveAll(dolist, '执');
        var list = beforeData.tmpDolist;
        localSave('dolist', list.join('*'));
        fixit(0, list, dolist);
      }
      solvedBtns[1].onclick = function() {
        beforeData.tmpDaylist = solveAll(daylist, '历');
        var list = beforeData.tmpDaylist;
        fixit(1, list, daylist);
        outOfTime();
      }
      solvedBtns[2].onclick = function() {
        beforeData.tmpWaitlist = solveAll(waitlist, '等');
        var list = beforeData.tmpWaitlist;
        fixit(2, list, waitlist);
      }

      var otoItemBtn = toGet('.toItemBtn');
      otoItemBtn.onclick = function() {
        toMainSquare(4, '模板');
      }

      var progressSim = toGet('.progressSim');

      function changeFinishProgress(num0, num1) { // 根据数量算百分比并保存
        getTime();
        var oScrollbar = toGet('.scrollbar_orange');
        var progress = toGet('.progress');
        var num0 = num0 || beforeData.tmpDolist.length;
        var num1 = num1 || beforeData.tmpDaylist.length;
        var num2 = beforeData.tmpWaitlist.length;
        var num3 = tmpRefreshA.length; // 刷新任务单
        
        n_allday = num0 + num1 + num2 + num3 + n_daytask;
        // log(n_allday,n_daytask,num0,num1,num2,num3);
        percent = '0%';
        if (n_allday) {
          percent = Math.ceil(n_daytask / n_allday * 100) + '%';
        }
        oScrollbar.style.width = percent;
        // log(today,finishList);
        // log(n_allday,n_daytask,percent);
        finishObj[today][0] = n_daytask;
        var weeklist = ['日', '一', '二', '三', '四', '五', '六'];
        var weekday = new Date().getDay();
        var littleSum = todayAdd + ' 周' + weeklist[weekday] + '  ' + n_daytask + '/' + n_allday + '  (' +
          percent + ')';
        progress.innerText = littleSum;
        progressSim.innerText = littleSum;
        finishObj[today] = [n_daytask, percent];
        localSave('finishObj', finishObj, 'object');
      }
     
      var addbtns = toGet('.addBtn', true);
      addbtns[0].onclick = function() {
        addItem();
        solveUl = dolist;
        writeboxTips.innerText = tipO['addDo'];
      }
      addbtns[1].onclick = function() {
        addItem();
        menuBtns[10].classList.add('active');
        writeboxTips.innerText = tipO['addDay'];
        solveUl = daylist;
      }
      addbtns[2].onclick = function() {
        addItem();
        solveUl = waitlist;
        writeboxTips.innerText = tipO['addWait'];
      }
      addbtns[3].onclick = function() {
        addItem();
        solveUl = project;
        writeboxTips.innerText = tipO['addItem'];
      }
      addbtns[4].onclick = function() {
        addItem();
        solveUl = maylist;
        writeboxTips.innerText = tipO['addMay'];
      }

      function addItem() {
        // 打开编辑区
        menuBtns[5].innerText = '添加项*';
        menuBtns[5].title = '清单添加，支持多项添加(快捷键Alt+Enter)';
        writeLayer();
      }

      function getList(obj, type) {
        var bs = obj.querySelectorAll('b.item');
        var list = [];

        for (let i = 0; i < bs.length; i++) {
          let val = bs[i].innerHTML;
          if (obj === daylist && /剩\s[0-9]+\s天/.test(val)) {
            let tempval = bs[i].innerText;
            let tempindex = /(?<=)剩\s[0-9]+\s天/.exec(tempval).index;
            // (?<=)剩\s[0-9]+\s天  检测
            val = val.slice(0, tempindex).trim();
          }
          if (obj === ocollectUl) { // 除了正确的链接，其他不可以
            val = val.replace(/&quot;/g, '"');
            val = val.replace(/&lt;/g, '<');
            val = val.replace(/&gt;/g, '>');
            val = val.replace(/<br>/g, '');
            let finalval = isSaveItem(val, null);
            // log(val, finalval);
            if (!isNowALink) {
              let regexA = /\<a[\s]+href[\s]*=[\s]*\"(http[s]?:\/\/\S+)\"[\s]*\>(.*?)\<\/a\>/;
              if (regexA.test(val)) { // ① 复制过来的a链接处理成合理格式
                let total = regexA.exec(val) ? regexA.exec(val)[0] : null;
                let url = regexA.exec(val) ? regexA.exec(val)[1] : '';
                let title = regexA.exec(val) ? regexA.exec(val)[2] : '链接';
                if (title && url && total) {
                  val = val.replace(total, `（<b class="link" onclick = toLink("${url}")>${title}</b>）`);
                  list[list.length] = val;

                }
              } else if (/[\<\>]+/g.test(val)) { // ② 失败格式的链接
                let div = document.createElement('div');
                div.innerHTML = val;
                list[list.length] = div.innerText;
              } else {
                list[list.length] = val;
              }
            } else { // 是链接
              let temp = linkSolved(val, 'resetLink');
              list[list.length] = temp;
            }
          } else {
            list[list.length] = val;
          }
        }
        return list;
      }

      var datacollectchange = [];

      function solveAll(obj, pre) {
        // 它的保存在它之后的 fixit 里的changeFinishProgress
        getTime();
        var inputs = obj.querySelectorAll('input');
        var bs = obj.querySelectorAll('b.item');
        var list = [];
        datacollectchange = [];
        // 当天完成的事项
        n_daytask = finishObj[today] ? finishObj[today][0] : 0;
        for (let i = 0; i < inputs.length; i++) {
          let val = bs[i].innerHTML;
          let tempval = bs[i].innerText;
          if (obj == daylist && /剩\s[0-9]+\s天/.test(val)) {
            let tempindex = /(?<=)剩\s[0-9]+\s天/.exec(tempval).index;
            val = val.slice(0, tempindex - 1);
          }
          if (inputs[i].checked && obj != ocollectUl) {
            finishList[finishList.length] = today + ' (' + pre + ') ' + val;
            n_daytask++;
          } else if (inputs[i].checked && obj == ocollectUl) {
            datacollectchange[datacollectchange.length] = val;
          } else {
            list[list.length] = val;
          }
        }
        // log(finishList);

        if (obj != ocollectUl) {
          datasimpleshow(finishList, places[1], 'simple');
        }
        return list;
      }

      var nowCollect = 0;
      var clearallBtn = toGet('.clearall');
      clearallBtn.classList.add('hidden');
      clearallBtn.onclick = function() {
        // nowCollect 为 0时是刷新任务表，所以没有删除的说法
        tellyouTip(`【清空操作】确定要清空当前${nowCollect===1?'参考资料':'回收箱'}的所有内容吗？删除的数据将无法恢复。`, 'sure', 'del');
      }

      function asidelistDel() {
        let list = [];
        if (nowCollect === 2) {
          // nowCollect 为2，清空回收箱
          beforeData.tmpRecycle = [];
          recycle.innerHTML = '';
          saveData();
        } else if (nowCollect === 1) {
          // nowCollect 为1，清空参考资料表
          beforeData.tmpReference = [];
          reference.innerHTML = '';
          saveData();
        }
      }


      var asideTogs = toGet('.aside input', true);
      var collects = toGet('.aside .list', true);
      var orefername = toGet('.headname');
      var oasidecontrol = toGet('.aside .controlers');
      oasidecontrol.onclick = function(e) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        asideToggle(ele);
      }

      function asideToggle(ele) {
        var index = 0;
        var namelist = ['刷新任务', '参考资料', '回收箱'];
        if (ele.tagName === 'INPUT') {
          index = ele.getAttribute('data-index') * 1;
          if (index !== nowCollect) {
            collects[nowCollect].style.display = 'none';
            collects[index].style.display = 'block';
            nowCollect = index;
            orefername.innerText = namelist[index];
            if (index === 0) {
              clearallBtn.classList.add('hidden');
            } else {
              clearallBtn.classList.remove('hidden');
            }
          }
        }
      }

      var otoCopydata = toGet('.toCopydata');
      otoCopydata.onclick = function() {
        summPartToggle();
        toMainSquare(1);
        tosearchtag('「本本」');
        if (odownloadnowbtn.innerText === '编辑模式') {
          isTagEditshow();
        }
        // 复制到粘贴板  这种复制只支持文本框和文本域innput textarea (注意后者才支持换行符)
        // var copyData = beforeData.summaryList.join('\n');
        // writebox.value = copyData;
        // writebox.select();
        // document.execCommand('Copy'); // 执行浏览器复制命令
        // writeLayer();
      }
    </script>

    <script>
      //  下面是页面主菜单和书写框的按钮 以及页面展开折叠按钮
      var opages = toGet('#pages'); // 非设置部分
      var omain = toGet('.main');
      var owrite = toGet('.write');
      var writebox = owrite.getElementsByClassName('writebox')[0];
      var writeboxTips = owrite.getElementsByClassName('writeboxTips')[0];

      var oresource = toGet('.resource');
      var uls = toGet('.detailSimple', true);
      var ostart = toGet('.start');
      var obook = toGet('.book');
      var oshowings = toGet('.onepart', true);
      var simplebtns = omenu.querySelectorAll('.simplebtn');
      var onowlocation = omenu.querySelector('.nowlocation');
      var ologo = toGet('.logo');

      for (let i = 0; i < parts.length; i++) {
        oheaders[i].onclick = function() {
          if (oheaders[i].getAttribute('data-id') === '0') {
            parts[i].style.display = 'block';
            oheaders[i].setAttribute('data-id', '1');
            oheaders[i].querySelector('h2').classList.add('showing');
          } else {
            parts[i].style.display = 'none';
            oheaders[i].setAttribute('data-id', '0');
            oheaders[i].querySelector('h2').classList.remove('showing');
          }
        }
      }

      simplebtns[0].onclick = toSimplePart;

      simplebtns[1].onclick = function() {
        toNewpart(0);
      }
      simplebtns[2].onclick = function() {
        toNewpart(1);
      }
      simplebtns[3].onclick = function() {
        toNewpart(2);
      }

      simplebtns[4].onclick = function() {
        toNewpart(3);
      }

      function showTaskContent() {
        // 显示的情况下，根据data-open & 是否在本页决定来关闭
        if (oshowings[3].style.display === 'block') { // 在帮助页
          if (txtpartshow !== 5) { // 跳转到目标
            var olis = obookmenu.getElementsByTagName('li');
            olis[txtpartshow].classList.remove('active');
            txtparts[txtpartshow].classList.remove('active');
            olis[5].classList.add('active');
            txtparts[5].classList.add('active');
            txtpartshow = 5;
            if (isOpenSetting) {
              oshowings[n_newpartshow].style.top = '52px';
              osettingbtn.setAttribute('data-change', '1');
            }
            window.scrollTo(0, 0);
          } else { // 已在目标页 -- 关闭
            toNewpart(3);
          }

        } else { // 转到目标
          n_oldpartshow = n_newpartshow;
          toNewpart(3, 'refresh', 5);
        }


      }
      var ojumpToRefresh = toGet('.jumpToRefresh');
      var oprogressOut = toGet('.progress-outer');
      var otaskwarn = toGet('.taskwarn');
      ojumpToRefresh.onclick = showTaskContent;
      oprogressOut.onclick = function(e) {
        var ele = e.target;
        if (ele.nodeName === 'MARK') {
          toMainSquare(5, '定期');
        } else {
          showTaskContent();
        }
      };

      var nowTipType = '';
      var nowTipHelpData = null;
      var tellyoubox = toGet('.tellyoubox');
      var tellyouBtns = tellyoubox.querySelectorAll('.btn');

      function tellyouTip(txt, type, data) {
        nowTipType = type;
        nowTipHelpData = data ? data : null;
        tellyoubox.querySelector('.title').innerText = txt;
        var oinput = tellyoubox.querySelector('input');
        oinput.value = '';
        if (nowTipType === 'tip') {
          tellyoubox.className = 'tellyoubox active tip';
        } else if (nowTipType.indexOf('sure') === 0) {
          // sure | sureitem | suredelitem | sureDel
          tellyoubox.className = 'tellyoubox active sure';
          oinput.setAttribute('placeholder', '输入值');

        } else {
          tellyoubox.className = 'tellyoubox active';
          if (nowTipType === 'totop') {
            oinput.value = data;
            oinput.focus();
            oinput.setAttribute('placeholder', '格式“分钟 | 主题内容”');
          } else if (nowTipType === 'calendar') {
            if (isNaN(data.slice(0, 4) * 1)) {
              oinput.value = data.slice(0, -7);
              nowTipHelpData = data.slice(-7);
              oinput.setAttribute('placeholder', '删除操作用关键字 ' + data.slice(0, -7));
            } else {
              oinput.focus();
              oinput.setAttribute('placeholder', data.slice(11));
              oinput.setAttribute('data-date', data.slice(0, 11));
            }
          } else if (nowTipType === 'okRefresh') {
            let tmpval = nowTipHelpData.querySelector('b').innerText.slice(3);
            oinput.value = tmpval;
          }else if (nowTipType === 'okPeriodVal'){
            oinput.value = nowTipHelpData.slice(10);
            // log(nowTipType, nowTipHelpData)
          }
        }
      }

      toGet('.tellBtnClose').onclick = function() { // 关闭框
        this.parentElement.className = 'tellyoubox';
      }

      tellyouBtns[0].onclick = function() { // 取消
        if (nowTipType === 'sureitem' && tmpValue) {
          let signIndex = tmpValue.lastIndexOf('@');
          let sign = ' @' + nowTipHelpData;
          writebox.value = tmpValue.slice(0, signIndex) + `${nowTipHelpData==='不修改'?'':sign}`;
          writebox.focus();
        }
        tellyoubox.className = 'tellyoubox';
        nowTipType = '';
        nowTipHelpData = null;
        // 若删除框存在则关闭
        if (omoreDelPart.classList.contains('active')) {
          delCalendarPartShow(null, 'cancel');
        }
      }

      var osavePathTxt = toGet('.savePathTxt');
      var ojumpToPath = toGet('.jumpToPath');
      ojumpToPath.onclick = function() {
        if (window.utools) {
          let file = osavePathTxt.innerText.slice(0, -10);
          // utools.shellShowItemInFolder(file); // 只显示文件夹
          utools.shellOpenPath(file); // 进入文件夹，也可以打开文件（系统默认的打开方式）

        }
      }
      tellyouBtns[1].onclick = function() { // 确定
        var input = tellyoubox.querySelector('input').value;
        input = isSaveItem(input, null) ? input.replace(/[\s]*/g, '') : '';
        if (nowTipType === 'json导出' && input) {
          if (input === '我了解') {
            tellyoubox.className = 'tellyoubox';
            let filename = todayAdd + 'Doit同步文件.json';
            download(filename, nowTipHelpData, 'application/json');
          } else {
            tellyoubox.querySelector('input').value = '';
          }
        } else if (nowTipType === '删除标志' && input) { // 项目标志删除
          tellyoubox.className = 'tellyoubox';
          let sign = input;
          itemsignDelFun(nowTipHelpData, sign);
        } else if (nowTipType.indexOf('覆盖') !== -1 && input) { // nowTipType === txt覆盖  导入覆盖
          if (input === 'doit') {
            if (nowTipHelpData === '导入') {
              txtTodata(writeBoxForCopy.value);
              openInoutWrite('open');
              writeBoxForCopy.value = '(本显示框的数据已成功导入)';
            } else {
              readFileFun(nowTipHelpData);
            }
            tellyoubox.className = 'tellyoubox';
          } else {
            tellyoubox.querySelector('input').value = '';
          }
        } else if (nowTipType === 'sure') { // 确定操作
          if (nowTipHelpData === 'del') {
            asidelistDel();
          }
          if (nowTipHelpData === '同步') {
            [s_doitData, SAVEPATH] = window.readConfig('同步');
            sendDataIn(s_doitData);
            utools.showNotification('数据同步成功');
            loadAgain();
            osavePathTxt.innerText = SAVEPATH;
            ojumpToPath.classList.add('active');
          }
          if (nowTipHelpData === '开启保存') {
            userDefined['saveLocalChose'] = 1;
            var osavelocalchoose = toGet('.savelocalchoose');
            osavelocalchoose.setAttribute('data-txt', '关闭');
            osavelocalchoose.classList.add('active');
            localSave('userDefined', userDefined, 'object');
          }
          if (nowTipHelpData === '开启记录') {
            userDefined['recordSearchChose'] = 1;
            var orecordchoose = toGet('.recordchoose');
            orecordchoose.setAttribute('data-txt', '关闭');
            orecordchoose.classList.add('active');
            localSave('userDefined', userDefined, 'object');
          }
          if (nowTipHelpData === '清空问题') {
            oquesCon.innerHTML = '';
            oquesConwrapper.scrollTop = -35;
            localDel('questxt');
          }
          if (nowTipHelpData === '清空导入框') {
            writeBoxForCopy.value = '';
            writeBoxForCopy.focus();
          }
          if (nowTipHelpData === '清空所选项') {
            allDelFun();
          }
          if (nowTipHelpData === '清空互用数据') {
            delete dataObj['linkconnectObj'];
            linkConnectObj = {};
            localSave('dataObj', dataObj, 'object');
            linknectShowFun();
          }
          if (nowTipHelpData === '清空逾期项') {
            let isDo = false;
            for (let i = 0; i < expirelist.length; i++) {
              let key = expirelist[i];
              if (key) {
                delete omemory[key];
                isDo = true;
              }
            }
            if (isDo) {
              omemory['origin'] = lastDate;
              localSave('memoryObj', omemory, 'object');
              omemoryCons[5].innerHTML = '<li class="justtip">（逾期项清除了）</li>';
            }
          }

          tellyoubox.className = 'tellyoubox';
        } else if (nowTipType === 'tip') {
          tellyoubox.className = 'tellyoubox';
          nowTipType = '';
        } else if (nowTipType === 'sureitem' && tmpValue) { // 项目
          beforeData['tmpProject'][changeId] = tmpValue;
          datashow(beforeData.tmpProject, project);
          tmpNode.innerHTML = tmpValue;
          tmpNode = null;
          tmpValue = null;
          writebox.value = '';
          writeLayer();
          saveData();
          tellyoubox.className = 'tellyoubox';
        } else if (nowTipType === 'suredelitem') { // 删除项目
          itemObj[nowTipHelpData][1] = {};
          localSave('itemObj', itemObj, 'object');
          oitemAllPeriod.innerHTML = '';
          tellyoubox.className = 'tellyoubox';
        } else if (nowTipType === 'totop') { // 定在桌面

          if (window.utools) {
            window.separateWin(); // 模拟分离插件快捷键ctrl+d  无效？
          }
          let tnum = input.indexOf('|');
          if (tnum === -1) { // 无分割线 
            if (isNaN(input * 1) || input * 1 === Infinity || input * 1 === -Infinity || input === '') {
              makeitTop(0, input);
            } else {
              let valtime = Math.abs(input);
              makeitTop(valtime * 60, '(定时' + valtime + '分钟)');
            }
          } else { // 有分割线，同时有值与内容
            let ttime = input.slice(0, tnum);
            ttime = /(\d+)/.exec(ttime) ? /(\d+)/.exec(ttime)[1] : 0;
            let ttxt = input.slice(tnum + 1);
            if (ttime === '00') {
              ttime = Math.ceil(timeCount.totalMin * 60 - (getWorkTime('try') / 1000)) - 3;
              ttxt = ttxt + ' (定时' + timeCount.totalMin + '分钟)';
            } else {
              ttxt = ttxt + ' (定时' + ttime + '分钟)';
              ttime = ttime * 60;
            }
            makeitTop(ttime, ttxt);
          }
          tellyoubox.className = 'tellyoubox'; // 关闭
          utools.setSubInputValue('');

        } else if ((nowTipType === 'calendar' || nowTipType === 'okPeriodVal') && input) {
          let idx = input.indexOf('+');
          let date = '';
          if(nowTipType === 'okPeriodVal'){
            date = tellyoubox.querySelector('input').getAttribute('data-date').trim();
          }else{
            date = nowTipHelpData.slice(0, 10);
          }
          // log(nowTipHelpData, date);
          let markList = 'del,monthDel,typeDel,periodDel,periodDelAll,plantDel,termDel';
          if (idx !== -1) { // ① 有+号时 => 添加
            let ok = formatCalendarFun(input, date, nowTipType);
            if (ok) {
              tellyoubox.className = 'tellyoubox';
              nowTipHelpData = null;
            }
          } else if (markList.indexOf(input) !== -1 || input.indexOf('hobbitDel-') !== -1) { // ② del相关 => 删除
            let ym = date.slice(0, 7);
            let isDel = false;
            if (input === 'del') { // a.删除当日内容
              if (dcalendarType === 'hobbit') { // ①习惯项不可按天删除
                tellyoubox.querySelector('input').value = '(习惯项不支持按天删除哦)';
              } else {
                let day = date.slice(-2);
                let obj = calendarData[dcalendarType];
                if (obj[ym][day]) { // 该天有值才可以删
                  // sign的处理
                  let signobj = obj[ym]['sign']; // 对象
                  let dayobj = obj[ym][day]; // 该天的数组数据
                  let isSubtract = false;
                  for (let m = 0; m < dayobj.length; m++) {  // 单条数据
                    let name = dayobj[m].slice(0, dayobj[m].indexOf('+'));
                    let value = dayobj[m].slice(dayobj[m].indexOf('+') + 1);
                   
                    if (name === '期物') {
                      let val = dayobj[m].slice(dayobj[m].indexOf('+') + 1);
                      let left = formatString(signobj['期物'].replace(val, ''), '，');
                      signobj['期物'] = left ? left : '';
                      // signobj['期物'] 得到该月sign对象内，期物除掉当天的字符串内容

                      if (ym === nextYM && signobj['期物']) {
                        txtData['willOverdueTxt'] = signobj['期物'];
                      }
                      if (signobj['期物'] === '，' || signobj['期物'] === '') {
                        //当没有其他期物内容时删掉该key
                        delete signobj['期物'];
                        txtData['willOverdueTxt'] = '';
                      }
                      toGet('.willOverdueTxt').innerText = txtData['willOverdueTxt'] ? '下个月会过期的有：' + txtData[
                        'willOverdueTxt'] : '';
                    } else if(dcalendarType === 'special'){ // ② 特殊类目普通项
                      tmpListenTime['specialChange'] = Date.now();
                      signobj[name] = signobj[name] - 1 >= 0 ? signobj[name] - 1 : 0;
                      if (signobj[name] === 0) {
                        delete signobj[name];
                      }
                    }

                    if (dcalendarType === 'count') { // ③ 收入
                      let otitle = tellyoubox.querySelector('.title').innerText;
                      let con = /工作([\d\.]+h)，共收入([\d]+)/.exec(otitle);
                      // log(con, con[0]);
                      isSubtract = true;
                      let temp = con[1] + '&' + con[2];
                      obj[ym]['total'] = calcCalendarFun(obj[ym]['total'], temp, 'subtract', 'count');
                      obj['total'] = calcCalendarFun(obj['total'], temp, 'subtract', 'count');
                      if (obj[ym]['total'] === '0h&0') {
                        delete obj[ym]['total'];
                      }
                    } else if (dcalendarType === 'cost') { // ④ 单项支出
                      let money = calcCalendarFun('0', value, 'add', 'cost');
                      isSubtract = true;
                      signobj[name][0] = signobj[name][0] - 1 >= 0 ? signobj[name][0] - 1 : 0;
                      signobj[name][1] = signobj[name][1] - money;
                      if (signobj[name][0] === 0) {
                        delete signobj[name];
                      }
                    }
                    delete obj[ym][day];
                    isDel = true;
                  }
                  if(isSubtract){
                    let otitle = tellyoubox.querySelector('.title').innerText;
                    if (dcalendarType === 'count') { // ③ 收入
                      let con = /工作([\d\.]+h)，共收入([\d]+)/.exec(otitle);
                      let temp = con[1] + '&' + con[2];
                      obj[ym]['total'] = calcCalendarFun(obj[ym]['total'], temp, 'subtract', 'count');
                      obj['total'] = calcCalendarFun(obj['total'], temp, 'subtract', 'count');
                      if (obj[ym]['total'] === '0h&0') {
                        delete obj[ym]['total'];
                      }
                    } else if (dcalendarType === 'cost') {
                      let otitle = tellyoubox.querySelector('.title').innerText;
                      let cost = /日常支出：([\d\.]+)/.exec(otitle);
                      if (cost && cost[0]) {
                        let money = cost[0];
                        obj[ym]['total'] = calcCalendarFun(obj[ym]['total'], money, 'subtract', 'cost');
                        obj['total'] = calcCalendarFun(obj['total'], money, 'subtract', 'cost');
                        if (obj[ym]['total'] === 0) {
                          delete obj[ym]['total'];
                        }
                      }
                    }
                  }
                }
              }
            } else if (input === 'monthDel' && calendarData[dcalendarType] && calendarData[dcalendarType][
              ym]) { // b.删除月数据
              if (dcalendarType === 'hobbit' && calendarData['hobbit']['total']) {
                let oosign = calendarData['hobbit'][ym]['sign'];
                for (let kk in oosign) {
                  calendarData['hobbit']['total'] = calendarData['hobbit']['total'] - oosign[kk][0];
                }
                // hobbitDataFun();
              }
              if (dcalendarType === 'count' && calendarData['count'][ym]['total']) {
                let oototal = calendarData['count'][ym]['total'];
                calendarData['count']['total'] = Operate(calendarData['count']['total'], oototal, 'h&');
              }
              if (dcalendarType === 'cost' && calendarData['cost'][ym]['total']) {
                let ooototal = calendarData['cost'][ym]['total'];
                calendarData['cost']['total'] = Operate(calendarData['cost']['total'], ooototal);
              }
              isDel = delete calendarData[dcalendarType][ym];
              if (dcalendarType === 'special') {
                tmpListenTime['specialChange'] = Date.now();
              }
            } else if (input === 'typeDel') { // c.删除类型
              calendarData[dcalendarType] = {};
              isDel = true;
              if (dcalendarType === 'hobbit') {
                localDel('calendarHobbit');
                hobbitData = {};
              }
              if (dcalendarType === 'special') {
                tmpListenTime['specialChange'] = Date.now();
              }
            } else if (input === 'periodDel' || input === 'periodDelAll') { // d.删除月经
              let periodA = calendarData['special']['月经'] ? calendarData['special']['月经']['days'] : null;
              if (periodA && input === 'periodDelAll') {
                isDel = delete calendarData['special']['月经'];
              } else if (periodA && periodA.includes(date)) {
                periodA = periodA.splice(periodA.indexOf(date), 1);
                isDel = true;
              }

            } else if (input === 'plantDel' && calendarData['special']['植物']) { // e.删除植物
              isDel = delete calendarData['special']['植物'];
            } else if (input === 'termDel' && calendarData['special'][ym] && calendarData['special'][ym]['sign']) { // f.删除期物
              tmpListenTime['specialChange'] = Date.now();
              let ymObj = calendarData['special'][ym];
              let hasdata = calendarData['special'][ym]['sign']['期物'];
              if (hasdata) {
                isDel = delete ymObj['sign']['期物'];
                for (let item in ymObj) {
                  if (item !== 'sign') {
                    // log(item);
                    ymObj[item] = ymObj[item].filter(function(val) {
                      if (val.indexOf('期物+') === -1) {
                        return val;
                      }
                    })
                    if (ymObj[item].length === 0) {
                      delete ymObj[item];
                    }
                  }
                }
              }
              if (nextYM === ym) {
                toGet('.willOverdueTxt').innerText = '';
                txtData['willOverdueTxt'] = '';
              }
            } else if(input.indexOf('hobbitDel-') === 0 && calendarData['hobbit'][ym]){ // g.删除本月某个习惯的数据
              let delTag = input.slice(10).trim();
              let thisM = calendarData['hobbit'][ym];
              let osign = thisM['sign'];
              if(osign && osign[delTag]){
                let len = osign[delTag][0];
                calendarData['hobbit']['total'] -= len;
                 
                for(let y = 0; y < len; y++){
                  let day = osign[delTag][2][y];
                  let thisDay = thisM[day];
                  let tmpVal = delTag+'+'+osign[delTag][1][y];
                  thisDay.splice(thisDay.indexOf(tmpVal), 1);
                  if(thisDay.length === 0){
                    delete calendarData['hobbit'][ym][day];
                  }
                }
                isDel = delete osign[delTag];
                if(JSON.stringify(osign) === '{}'){
                  delete calendarData['hobbit'][ym];
                }
              }
            }
            if (isDel) {
              localSave('calendar', calendarData, 'object');
              nowCalendarShow();
              delCalendarPartShow(null, 'cancel');
              tellyoubox.className = 'tellyoubox';
              nowTipHelpData = null;
            }
          }


        } else if (nowTipType === 'sureDel') { // 全部清空
          allDelFun(nowTipHelpData);
          tellyoubox.className = 'tellyoubox';
        } else if (nowTipType === 'okRefresh') { // 刷新任务完成
          let val = nowTipHelpData.querySelector('b').innerText;
          let smoothly = false;
          // 1. 同步在习惯日历的处理
          if (/^#/.test(input)) {
            if (input.indexOf('+') !== -1) {
              dcalendarType = 'hobbit';
              let ok = formatCalendarFun(input.slice(1));
              if (ok) {
                smoothly = true;
              }
            }
          } else {
            smoothly = true;
          }

          if (smoothly) {
            // 2. 刷新任务完成操作
            let obj = {};
            let temp = '';
            let str = '';
            let front = val.substring(0, 3);
            n_daytask = finishObj[today] ? finishObj[today][0] : 0;
            n_daytask++;
            getDatelist();
            finishList[finishList.length] = today + front + input;
            localSave('finishlist', finishList, 'object');
            datasimpleshow(finishList, places[1], 'simple');
            datasimpleshow(finishList, uls[4], 'simple');
            showFinishtask();
            checkSummary();
            // debugger
            if (front === '【日】') {
              str = date + '';
              obj = delRefreshArr[0] || {};
              if (obj && obj[str]) {
                temp = obj[str] + '^' + val;
              } else {
                temp = val;
              }
              obj[str] = temp;
              delRefreshArr[0] = obj;
            } else if (front === '【周】') {
              str = date - week + 1 + '';
              obj = delRefreshArr[1] || {};
              if (obj && obj[str]) {
                temp = obj[str] + '^' + val;
              } else {
                temp = val;
              }
              obj[str] = temp;
              delRefreshArr[1] = obj;
            } else if (front === '【月】') {
              str = month + '';
              obj = delRefreshArr[2] || {};
              if (obj && obj[str]) {
                temp = obj[str] + '^' + val;
              } else {
                temp = val;
              }
              obj[str] = temp;
              delRefreshArr[2] = obj;
            }
            // log(delRefreshArr);
            refresh.removeChild(nowTipHelpData);
            localSave('delRefresh', delRefreshArr, 'object');
            refreshfun();
            refreshDetailFun();
            changeFinishProgress();
            tellyoubox.className = 'tellyoubox';
            nowTipHelpData = null;
          }

        } 
        if (nowTipType !== 'calendar' && nowTipType !== 'okRefresh') {
          // 因为刷新任务同步在习惯日历中会有【格式不对的情况】等着再次操作-故先不为空
          nowTipHelpData = null;
        }
      }

      var oneedhelpbtns = toGet('.needhelpbtn', true); // 书写框的秘与切
      oneedhelpbtns[1].onclick = function() {
        tellyouTip(tellO['writeTxt'], 'tip');
      }
      oneedhelpbtns[0].onclick = function() {
        // 共有五个状态
        // tt同一次书写框的第n次切换, ttt同一次书写框的首次切换 -> 用data-val保存要切换的内容
        let value = writebox.getAttribute('data-val'); // 没有值时为null
        let index = writebox.getAttribute('data-num'); // index 表明当前切换的情况，没有值时为null;
        let ttt = writebox.value.trim();
        if (value == null && ttt && index == null) { // 还有一种情况是当前内容为空，也不存入data-val里
          value = ttt;
          writebox.setAttribute('data-val', ttt); // 对应的在书写框关闭是remove该属性
        }
        writebox.value = '';

        // log(index, todayAdd)
        if (index === '3') {
          writeLayer('定期任务');
          writebox.value = value ? value + ' ' + todayAdd : '';
          orefreshbtn.innerText = '新增定期任务';
          writeboxTips.innerText = tipO['addRegular'];
        } else if (index === '4') {
          writeLayer('日期倒计时');
          writebox.value = value ? value + ' ' + todayAdd : txtData['countDown'];
          orefreshbtn.innerText = '定日期倒计时';
          writeboxTips.innerText = tipO['addCountdown'];
        } else {
          if (index && index * 1 > 4) {
            index = '0';
          }
          writeLayer('刷新任务');
          refreshfun(index * 1 + 4);
          let oldvalue = '';
          if (index == null || index === '0') {
            orefreshbtn.innerText = '确定日刷任务*';
            oldvalue = txtData['dayRefresh'];
          } else if (index === '1') {
            orefreshbtn.innerText = '确定周刷任务*';
            oldvalue = txtData['weekRefresh'];
          } else if (index === '2') {
            orefreshbtn.innerText = '确定月刷任务*';
            oldvalue = txtData['monthRefresh'];
          }
          writebox.value = oldvalue ? oldvalue + (value ? '*' + value : '') : (value ? value : '');
        }
        writebox.setAttribute('data-num', index * 1 + 1);
      }

      var oinoutHelpbtns = toGet('.inoutHelpbtn', true);
      oinoutHelpbtns[0].onclick = function() { // 简版页输入-注
        tellyouTip(tellO['inoutTxt'], 'tip');
      }
      oinoutHelpbtns[1].onclick = inputRegExp; // 简版页输入-凸

      // simplebtns[5].onclick = toNewPlugin;
      oinoutHelpbtns[2].onclick = function() { // 简版页输入-清空
        if (writeBoxForCopy.value.trim()) {
          tellyouTip(tellO['delTextarea'], 'sure', '清空导入框');
        }
      }
      var osimplePbtns = omain.querySelectorAll('.simplebtn');
      var file_input = toGet('#file_input');
      osimplePbtns[0].onclick = function() {
        file_input.value = '';
      }

      function readUseData() {
        [s_doitData, SAVEPATH] = window.readConfig();
        if (!s_doitData) {
          [s_doitData, SAVEPATH] = window.readConfig('同步');
          log('拉取的是官方数据');
        }
        if (s_doitData) {
          sendDataIn(s_doitData);
          utools.showNotification('成功获取用户数据');
          loadAgain();
        } else {
          utools.showNotification('数据获取失败');
        }
        osavePathTxt.innerText = SAVEPATH;
        ojumpToPath.classList.add('active');
      }

      osimplePbtns[1].onclick = function() { // 拉取本地
        osimplePbtns[2].title = '需先在上面选择要加载的json文件，再拉取';
        var files = file_input.files;
        if (files.length > 0) { // 判断文件存在
          var file_data = files[0];
          // log(file_data);
          if (/\.json$/.test(file_data.name)) {
            let reader = new FileReader();
            reader.readAsText(file_data, 'UTF-8'); // 读取纯文本文件,且编码格式为 utf-8
            // 读取文件,会触发 onload 异步事件,可使用回调函数 来获取最终的值.
            reader.onload = function(e) {
              let fileContent = e.target.result;
              sendDataIn(fileContent);
              loadAgain();
              file_input.value = '';
              tellyouTip(tellO['userOk'], 'tip');
              // window.location.reload();
            }
          } else {
            tellyouTip(tellO['userWarn'], 'tip');
            file_input.value = '';
          }
        } else {
          if (window.utools) {
            readUseData();
          } else {
            tellyouTip(tellO['userHelp'], 'tip');
          }
        }
      }

      var writeBoxForCopy = toGet('.writeBoxForCopy');
      osimplePbtns[2].onclick = function() {
        var files = file_input.files;
        var list = [];
        var justOpen = false;
        let ttxt = '';
        // log(files);
        if (files.length > 0 && /\.txt$/.test(files[0].name)) { // 判断文件存在
          tellyouTip(tellO['fileInput'], 'txt覆盖', files);
        } else if (files.length > 0) {
          tellyouTip(tellO['warnTxtFile'], 'tip');
        } else if (writeBoxForCopy.value.trim()) {
          tellyouTip(tellO['dataInput'], '导入覆盖', '导入');
        } else {
          tellyouTip(tellO['helpInput'], 'tip');
        }
      }

      function txtTodata(data) {
        let nmatch = data.match(/(\^)/g);
        if (nmatch) {
          list = data.split('^');
          if (nmatch.length > 1) {
            datacollectbox = list[0].split('&');
          }
          sortBoxStr = list[nmatch.length - 1];
          beforeData.checkList = list[nmatch.length].split('&');

        } else {
          // log('默认为导入收集箱');
          datacollectbox = data.split('&');
        }

        localSave('collect', datacollectbox, 'object');
        localSave('collectSortBox', sortBoxStr);
        localSave('checklist', beforeData.checkList, 'object');
        strToList(sortBoxStr); // 确保数据替换
        // 简版的数据更正
        datasimpleshow(memorylist, uls[0], 'memory');
        datasimpleshow(beforeData.tmpDolist, uls[1], 'simple', '【执】 ');
        datasimpleshow(beforeData.tmpDaylist, uls[2], 'simple', '【限】');
        datasimpleshow(beforeData.tmpWaitlist, uls[3], 'simple', '【待】 ');
        datasimpleshow(finishList, uls[4], 'simple');
      }

      function readFileFun(files) {
        var file_data = files[0];
        // log(file_data);
        if (/\.txt$/.test(file_data.name)) {
          let reader = new FileReader();
          reader.readAsText(file_data, 'UTF-8'); // 读取纯文本文件,且编码格式为 utf-8
          // 读取文件,会触发 onload 异步事件,可使用回调函数 来获取最终的值.
          reader.onload = function(e) {
            let fileContent = e.target.result;
            txtTodata(fileContent);
            let txt = '文件' + file_data.name + '的数据已成功导入';
            tellyouTip(txt, 'tip');
            file_input.value = '';
          }
        }
      }

      osimplePbtns[3].onclick = synDataToLocal;
      var osavebtn = toGet('.savebtn');
      osavebtn.onclick = synDataToLocal;

      function synDataToLocal() { // 同步到本地
        let data = sendDataOut();
        if (window.utools) {
          window.writeConfig(data);
          if (isUtoolsOut) {
            utools.showNotification('所有数据清理完毕（包括本地的）');
          }
        } else {
          tellyouTip(tellO['userOutput'], 'json导出', data);
        }
      }



      osimplePbtns[4].onclick = toOutput;

      osimplePbtns[5].onclick = function() {
        toOutput('solve');
      }

      osimplePbtns[6].onclick = function() { // 说明
        tellyouTip(tellO['inOutputTip'], 'tip');
      }
      osimplePbtns[7].onclick = function() {
        openInoutWrite('open');
        toOutput('backup', 'copy');
      }
      osimplePbtns[8].onclick = function() {
        openInoutWrite('open');
        toOutput('solve', 'copy');
      }



      function toOutput(type, copy = 'not') {
        getTime();
        strToList(sortBoxStr); // 确保数据替换
        let list = [];
        let listStr = '';
        let filename = '';
        let tempFreshList = []; // 收集刷新任务
        let tempMemoryList = []; // 收集记忆列表
        let tempObj = localGet('memoryObj', 'object');
        let tempRegularList = []; // 收集定期任务列表
        regularObj = localGet('regularObj', 'object');
        let temp1 = [];
        let temp5 = [];
        let temp0 = [];
        let aftertxt = '';
        let dakatxt = '';
        let n = 7;
        // 导出数据有两种：
        // ①下次使用的备份 = 事项清单的组合"collectSortBox",sortBoxStr（包括参考资料，回收箱）+ 检查卡"checklist",beforeData.checkList
        // ②数据再次处理 = 参考资料beforeData.tmpReference + 完成卡"finishlist",finishList + 随记"summarylist",beforeData.summaryList
        // 参考列表temp2  自定义链接temp3，完成卡temp0，随记temp1，刷新任务tempFreshList， 记忆清单tempMemoryList ，检查卡temp5
        if (type === 'solve') {
          temp1 = localGet('summarylist', 'object');
          list[1] = solveLink(temp1, '0');
          let temp2 = beforeData.tmpReference;
          let referStr = temp2.join('\n- ');
          if (/toLink/.test(referStr)) {
            list[2] = solveLink(temp2, '0');
          } else {
            list[2] = referStr;
          }
          if (userDefined['outputChose'] === undefined || userDefined['outputChose'] !== 'simple') {
            temp0 = finishList;
            list[0] = temp0.join('\n- ');
            let temp3 = linkArr;
            list[3] = solveLink(temp3, '0');
            if (refreshArr[0]) {
              tempFreshList[tempFreshList.length] = refreshArr[0];
            }
            if (refreshArr[1]) {
              tempFreshList[tempFreshList.length] = refreshArr[1];
            }
            if (refreshArr[2]) {
              tempFreshList[tempFreshList.length] = refreshArr[2];
            }
            list[4] = solveLink(tempFreshList, '1');
            temp5 = beforeData.checkList;
            list[5] = solveLink(temp5, '0');
            if (tempObj) {
              for (let key in tempObj) {
                if (key !== 'origin') {
                  tempMemoryList[tempMemoryList.length] = key + ':\n- ' + tempObj[key];
                }
              }
            }
            list[6] = solveLink(tempMemoryList, '2');
            if (regularObj) {
              for (let regulardate in regularObj) {
                if (regulardate !== 'datestr') {
                  let rrgli = regularObj[regulardate];
                  let rrgval = '';
                  if (rrgli.length === 2) {
                    rrgval = rrgli[1];
                  } else {
                    rrgval = rrgli.slice(1).join('\n- ');
                  }
                  tempRegularList[tempRegularList.length] = regulardate + ':\n- ' + rrgval;
                }
              }
            }
            list[7] = tempRegularList.join('\n- ');
          } else {
            let templist = [];
            temp0 = finishList;
            for (let k = 0; k < temp0.length; k++) {
              templist[k] = temp0[k].substring(14);
            }
            list[0] = templist.join('\n- ');
            n = 2;
          }
          let prename = [0, '小本本', '参考资料', '热链接', '刷新任务', '检查卡', '记忆卡', '定期任务'];

          for (let t = 1; t <= n; t++) {
            if (list[t] !== '0' && list[t].trim() !== '') {
              aftertxt += '\n\n> ' + prename[t] + '\n- ' + list[t];
            }
          }
          var dakadateobj = localGet('dakadateObj', 'object'); // {}日期对应打卡内容
          if (dakadateobj && dakadateobj[today]) {
            dakatxt = ' #' + dakadateobj[today];
          }
          listStr = '> ' + progressSim.innerText + dakatxt + '\n' + list[0] + aftertxt;

          if (copy === 'copy') {
            writeBoxForCopy.value = listStr;
            writeBoxForCopy.select();
            document.execCommand('Copy');
          } else {
            filename = todayAdd + '(Doit).md';
            download(filename, listStr, 'text/markdown');
          }
        } else {
          if (copy === 'copy') {
            let mdstr = '> 收集箱\n- ';
            let coldata = solveLink(datacollectbox, '0');
            mdstr = mdstr + coldata + '\n\n> 清单数据(7个 执|历|等|项|可|参考|回收)\n- ';
            let sevendata = solveLink(sortBoxStr.split('$'), '0');
            let tempList = sevendata.replace(/~/g, '\n\n- ');
            mdstr = mdstr + tempList + '\n\n> 检查卡\n- ';
            let checkdata = solveLink(beforeData['checkList'], '0');
            mdstr = mdstr + checkdata + '\n\n';
            writeBoxForCopy.value = mdstr;
            writeBoxForCopy.select();
            document.execCommand('Copy');
          } else {
            list[0] = datacollectbox.join('&');
            list[1] = sortBoxStr;
            list[2] = beforeData['checkList'].join('&');
            listStr = list.join('^');
            filename = todayAdd + 'Doit备份数据.txt';
            download(filename, listStr, 'text/txt');
          }
        }

        function solveLink(listContent, type) {
          let templist = listContent ? listContent : [];
          let newlist = [];
          if (templist.length !== 0) {
            if (type === '0') {
              newlist = listContent;
            }
            if (type === '1') {
              newlist = templist.join('*').split('*');
            }
            if (type === '2') {
              newlist = templist.join('\n- ').split('~');
            }

            for (let i = 0; i < newlist.length; i++) {
              if (/toLink/.test(newlist[i])) {
                newlist[i] = linkSolved(newlist[i], 'linktoMd');
              }
            }
            return newlist.join('\n- ');
          } else {
            return ' ';
          }
        }
      }

      function linkSolved(str, type) {
        // 应该注意 str除了链接，还有其他
        let div = document.createElement('div');
        div.innerHTML = str;
        let temp = div.innerText;
        let val = str.replace(/&quot;/g, '');
        var regex1 = /((https?|http):\/\/[-A-Za-z0-9%@#&+/?=~_|!:;,.]+[-A-Za-z0-9+&@#/%=~_|])/g;
        var regex2 = /((https?|http):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|])/g;
        var regex3 = /(http\S+)\)/g;
        let islink = regex1.exec(val) || regex2.exec(val) || regex3.exec(val);
        let istext = '';
        if (type === 'mdtoLink') {
          let mdlink = /\[([\u4E00-\u9FA5A-Za-z0-9_-\|\s]+)\]\((http|https):\/\/[\w\d+&@#\/%?=~_|!:,.;-]+\S/g
            .exec(
              val);
          istext = mdlink ? mdlink[0] : 'nxnnnaaannjdjdndnnnnbbbnn';
          var text = mdlink ? mdlink[1] : '链接';
        } else {
          let b = div.getElementsByClassName('link')[0];
          istext = b.innerText;
        }

        if (istext) {
          let url = islink[1].replace(/\\/g, '');
          url = url.replace(/\"/g, '');
          if (type === 'resetLink') {
            val = '<b class="link" onclick = toLink("' + url + '")>' + istext + '</b>';
          } else if (type === 'linktoMd') {
            val = '[' + istext + '](' + url + ')';
          } else if (type === 'mdtoLink') {
            val = '<b class="link" onclick = toLink("' + url + '")>' + text + '</b>';
          }
          temp = temp.replace(istext, val);
        }
        return temp;
      }

      function download(filename, content, type) {
        var blob;
        if (typeof window.Blob === 'function') {
          blob = new Blob([content], {
            type: type
          });
        } else {
          var BlobBuilder = window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window
            .MSBlobBuilder;
          var bb = new BlobBuilder();
          bb.append(content);
          blob = bb.getBlob(type);
        }
        if (navigator.msSaveBlob) {
          navigator.msSaveBlob(blob, filename);
        } else {
          var URL = window.URL || window.webkitURL;
          var bloburl = URL.createObjectURL(blob);
          var anchor = document.createElement('a');
          if ('download' in anchor) {
            anchor.style.visibility = 'hidden';
            anchor.href = bloburl;
            anchor.download = filename;
            document.body.appendChild(anchor);
            var evt = document.createEvent('MouseEvents');
            evt.initEvent('click', true, true);
            anchor.dispatchEvent(evt);
            document.body.removeChild(anchor);
          } else {
            location.href = bloburl;
          }
        }
      }


      omenu.onclick = function(event) {
        var e = event || window.event;
        var ele = e.target || e.srcElement;
        if (ele.tagName === 'SPAN') {
          getTime();
        }
      }


      function toSimplePart() { // 简版与编辑按钮
        window.scrollTo(0, 0);
        // var event = e || window.event;
        // var ele = event.target || event.srcElement;
        // var back = toGet('.bodybg');
        omain.classList.remove('unshow');
        opages.classList.remove('back');
        var isshow = false;
        // back.style.display = 'none';
        if (txtData['todayDaka']) {
          var dakatxt = '今天打卡了' + txtData['todayDaka'];
          progressSim.title = dakatxt;
          otodayDakaTxt.innerText = txtData['todayDaka'];
        }

        // 按钮和内容的切换
        if (n_newpartshow !== -1) {
          if (n_newpartshow === 1 && isTimeCounting) {
            oshowings[1].style.visibility = 'hidden';
            simplebtns[2].classList.add('counting');
          } else {
            oshowings[n_newpartshow].style.display = 'none';
          }
          simplebtns[n_newpartshow + 1].classList.remove('active');
          n_newpartshow = -1;
        }
        var val = simplebtns[0].getAttribute('data-name');
        var oparts = toGet('.content', true);

        if (val === '切简版') {
          oparts[0].style.display = 'none';
          oparts[1].style.display = 'block';
          simplebtns[0].setAttribute('data-name', '切编辑');
          simplebtns[0].classList.add('liner');
          omain.classList.add('simple');
          oasidemenu.classList.add('simple');
          omenu.classList.remove('on');
          isshow = true;
          ologo.style.display = 'none';
          onowlocation.innerText = '简版页';
          onowlocation.style.display = 'block';
        } else {
          oparts[0].style.display = 'block';
          oparts[1].style.display = 'none';
          omain.classList.remove('simple');
          oasidemenu.classList.remove('simple');
          simplebtns[0].setAttribute('data-name', '切简版');
          simplebtns[0].classList.remove('liner');
          omenu.classList.add('on');
          onowlocation.style.display = 'none';
          ologo.style.display = 'block';
        }

        if (isshow) {
          // 数据保存和渲染
          if (memorylist.length === 0) {
            uls[0].style.display = 'none';
            otoMemorypart.classList.remove('active');
          } else {
            datasimpleshow(memorylist, uls[0], 'memory');
            uls[0].style.display = 'block';
            otoMemorypart.classList.add('active');
          }
          datasimpleshow(beforeData.tmpDolist, uls[1], 'simple', '【执】 ');
          datasimpleshow(beforeData.tmpDaylist, uls[2], 'simple', '【限】');
          datasimpleshow(beforeData.tmpWaitlist, uls[3], 'simple', '【待】 ');
          datasimpleshow(finishList, uls[4], 'simple');
        }
      }

      var ocheckHeader = toGet('.check-header');
      var obookheader = toGet('.book-header');
      var oheaderboxs = obookheader.getElementsByClassName('share_box');
      var otoTeachNextBtn = toGet('.toTeachNextBtn');
      ocheckHeader.ondblclick = function() {
        if (ocheckHeader.classList.contains('smaller')) {
          ocheckHeader.classList.remove('smaller');
        } else {
          ocheckHeader.classList.add('smaller');
        }
      }

      function getRandomTxt(ele, type) {
        if (ele.innerText === '展开' || type === 'new') {
          var randomindex = 0;
          do {
            randomindex = Math.floor(Math.random() * 13);
          } while (n_randomshow === randomindex);

          // 0~12 13个值
          oheaderboxs[n_randomshow].classList.remove('active');
          oheaderboxs[randomindex].classList.add('active');
          n_randomshow = randomindex;
        }
        if (ele.innerText === '展开') {
          ele.classList.remove('unactive');
          ocheckHeader.classList.add('active');
          obookheader.style.display = 'block';
          otoTeachNextBtn.style.display = 'block';
          ele.innerText = '关闭';
        } else if (ele.innerText === '关闭') {
          ele.classList.add('unactive');
          ocheckHeader.classList.remove('active');
          obookheader.style.display = 'none';
          otoTeachNextBtn.style.display = 'none';
          ele.innerText = '展开';
        }
      }

      function toNewpart(num, type, which) { // 0-资料 1-启动 2-检 3-书
        // var back = toGet('.bodybg');
        var ofiveheart = toGet('.fiveheart');
        var locationName = ['资料页', '启动页', '检查页', '帮助页'];
        if (n_newpartshow === -1) {
          ologo.style.display = 'none';
          onowlocation.style.display = 'block';
        }

        onowlocation.innerText = locationName[num];

        if (num !== -1) {
          // 本页双击则关闭，他页进入则开启（主页或其他）
          if (oshowings[num].style.display !== 'block') { // 开启页面
            opages.classList.add('back');
            if ((isTimeCounting && num !== 1) || (isTimeCounting && n_newpartshow === 1)) {
              // log('1.除杂-计时+到非启动|计时+启动页离开', num)
              makeit(true, n_newpartshow, 'oStartOFF', false, oshowings[num]);
            } else {
              makeit(true, n_newpartshow, null, false, oshowings[num]);
              // log('常规', num);
            }
            oshowings[num].style.display = 'block';
            simplebtns[num + 1].classList.add('active');
            n_newpartshow = num;
            opages.classList.remove('ischeck');
            if (num === 2) {
              opages.classList.add('ischeck');
            }

          } else { // 当前页面是block  =  关闭页面 开启正在计数的页面
            opages.classList.remove('back');
            if (simplebtns[0].getAttribute('data-name') === '切简版') {

              if (!isTimeCounting) {
                onowlocation.style.display = 'none';
                ologo.style.display = 'block';
              } else if (num === 1 && oshowings[1].style.visibility === 'visible') {
                // 特殊情况： 计时时启动页是block并想回到主页时 
                onowlocation.style.display = 'none';
                ologo.style.display = 'block';
              }

            } else {
              onowlocation.innerText = '简版页';
            }

            if (num === 1) {
              if (n_newpartshow === 1) {
                if (isTimeCounting) {
                  makeit(false, null, 'oStartOFF', true, opages);
                } else {
                  makeit(true, n_newpartshow, null, true, opages);
                }
                n_newpartshow = -1;
              } else {
                makeit(true, n_newpartshow, 'oStartON', false, oshowings[1]);
              }
            } else {
              makeit(true, num, null, true, opages);
              n_newpartshow = -1;
            }
            if (num === 2) {
              opages.classList.remove('ischeck');
            }
          }

        }

        function makeit(isClear, index, type, isToMain, overflowObj) {
          if (isClear && index !== -1) {
            oshowings[index].style.display = 'none';
            simplebtns[index + 1].classList.remove('active');
          }

          if (type === 'oStartOFF') {
            ofiveheart.style.display = 'none';
            oshowings[1].style.display = 'block';
            oshowings[1].style.visibility = 'hidden';
            simplebtns[2].className = 'simplebtn runworkbtn counting';
          } else if (type === 'oStartON') {
            ofiveheart.style.display = 'inline-block';
            oshowings[1].style.visibility = 'visible';
            simplebtns[2].className = 'simplebtn runworkbtn active';
            n_newpartshow = 1;
          }

          if (!isToMain || index === -1) {
            // back.style.display = 'block';
            omain.classList.add('unshow');
          } else {
            // back.style.display = 'none';
            omain.classList.remove('unshow');
          }
        }

        if (n_newpartshow === -1 && simplebtns[0].getAttribute('data-name') === '切简版') {
          omenu.classList.add('on');
        } else {
          omenu.classList.remove('on');
        }
        if (num === 0 && n_newpartshow !== -1) {
          hotlinkload();
        }
        if (num === 2 && n_newpartshow !== -1) {
          showFinishtask();
          checkSummary();
        }
        if (num === 3 && n_newpartshow !== -1) {
          loadBook();
          if (type === 'refresh' || type === 'question' || type === 'review' || type === 'mecheck') {
            getTime();
            var olis = obookmenu.getElementsByTagName('li');
            olis[txtpartshow].classList.remove('active');
            txtparts[txtpartshow].classList.remove('active');
            olis[which].classList.add('active');
            txtparts[which].classList.add('active');
            txtpartshow = which;
            if (isOpenSetting) {
              oshowings[n_newpartshow].style.top = '52px';
              osettingbtn.setAttribute('data-change', '1');
            }
          }
        }
        window.scrollTo(0, 0);
      }

      var ocleartxtbtn = toGet('.cleartxtbtn', true); // 完成模块搜索框 he 中间笔记框 的 × 
      var omorewritebox = toGet('.morewritebox');
      ocleartxtbtn[0].onclick = function() {
        osearchtxtIn.value = '';
      }
      ocleartxtbtn[1].onclick = function() {
        omorewritebox.value = '';
      }
      omorewritebox.onkeydown = function(e) {
        var event = e || window.event;
        var keycode = event.keyCode || event.which;
        var val = omorewritebox.value.trim();
        if (val && keycode === 13) {
          inputDataSet(5, 'morewritebox', val);
          omorewritebox.value = '';
          omorewritebox.focus();
        }
      }
      var omorefunpart = toGet('.morefunpart');
      var omorePartBack = omorefunpart.querySelector('.back');
      var omoreSections = omorefunpart.querySelectorAll('.section');
      var oclosesectionbtn = omorefunpart.querySelector('.closetipbtn');
      var numOfSection = -1;
      var opartLinkUl = toGet('.partLinkUl');
      // omorePartBack.onclick = function () {
      //   toMainSquare(numOfSection);
      // }
      oclosesectionbtn.onclick = function() {
        toMainSquare(numOfSection);
      }
      var ojumpbtns = toGet('.jumpbtn', true);
      ojumpbtns[0].onclick = function() {
        toMainSquare(0);
      }
      ojumpbtns[1].onclick = function() {
        toMainSquare(1);
      }
      var ojumptagbtn = toGet('.jumptagbtn');
      ojumptagbtn.onclick = function() {
        toMainSquare(1);
      }
      var ojumpboxbtn = toGet('.jumpboxbtn');
      ojumpboxbtn.onclick = function() {
        toMainSquare(0);
      }
      var oquesCon = toGet('.quesCon');

      function conToquestxt() { // 保存
        let str = oquesCon.innerHTML;
        // 如何保证数据安全，保证格式正确
        let testtxt = str.replace(/<br>/g, '');
        testtxt = testtxt.replace(/<div>/g, '');
        testtxt = testtxt.replace(/<\/div>/g, '');
        if (isSaveItem(testtxt)) {
          quesConStr = isSaveItem(testtxt);
          localSave('questxt', str);
        }

      }

      ojumpbtns[2].onclick = function() {
        if (quesConStr === '') {
          oquesCon.innerHTML = localGet('questxt', 'string') ? localGet('questxt', 'string') : '';
        }
        toMainSquare(3);
      }
      ojumpbtns[3].onclick = function() {
        toMainSquare(4, '模板');
      }
      ojumpbtns[4].onclick = function() {
        toMainSquare(5);
      }

      var oquesConwrapper = toGet('.quesCon-wrapper');
      var oquesnav = toGet('.quesnav');
      oquesnav.onclick = function(e) {
        let event = e || window.event;
        let ele = event.target || event.srcElement;

        if (ele.tagName === 'SPAN') {
          let txt = ele.innerText;
          let str = oquesCon.innerHTML;
          if (txt === '存') {
            conToquestxt();
            ele.classList.add('green');
            setTimeout(function() {
              ele.classList.remove('green');
            }, 2000);
          } else if (txt === '模') {
            str += '<br><div>> ' + todayAdd +
              ' ( Ques: ) </div><div>- 试一下: </div><div>- 验证出: </div><br><div>- 试两下: </div><div>- 验证出: </div><br><div>- 试三下: </div><div>- 验证出: </div><div>- 启发: </div>';
            oquesCon.innerHTML = str;
          } else if (txt === '今') {
            str += '<div>' + todayAdd + '</div>';
            oquesCon.innerHTML = str;
          } else if (txt === '清') {
            tellyouTip(tellO['delQues'], 'sure', '清空问题');
          } else { // 回顶部
            oquesConwrapper.scrollTop = -35;
          }

        }
      }

      function toMainSquare(num, data = null, type = '') {
        // 0 收集箱 1标签 2链接互用 3问题记录 data为启动页进入  4项目管理 data为项目编号  5日历工具   6查找内容凸显 7总报
        if (omorefunpart.classList.contains('open') && num === numOfSection) { // 当前页关闭、
          if (num === 4) {
            itemClose();
          }
          // opages.style = '';
          let scrollnum = opages.getAttribute('data-top');
          window.scrollTo(0, scrollnum);

          omoreSections[num].classList.remove('active');
          omorefunpart.classList.remove('open');
          document.body.classList.remove('popuping');
          numOfSection = -1;
          if (num === 0) {
            datacollectSave();
          }
          if (num === 3) {
            conToquestxt();
          }

        } else {
          if (omorefunpart.classList.contains('open')) { // 关闭旧的打开新的
            if (numOfSection === 4) {
              itemClose();
            }
            omoreSections[numOfSection].classList.remove('active');
            if (numOfSection === 0) {
              datacollectSave();
            }
            if (num === 0) { // 
              datacollectshow(datacollectbox, ocollectUl);
            }
            if (num === 3) {
              conToquestxt();
            }
          } else { // 从关闭到打开
            let scroll = document.documentElement.scrollTop || document.body.scrollTop || 0;
            if (n_newpartshow === 0) {
              scroll = scroll;
            }

            opages.setAttribute('data-top', scroll);
            omorefunpart.classList.add('open');
            document.body.classList.add('popuping');
            if (num === 0) { // 其他情况已在保存里实现
              tempcheckcountnum = 0;
              ocollectPnums[1].innerHTML = tempcheckcountnum;
              datacollectshow(datacollectbox, ocollectUl);
            }

            if (num === 3 && data === '启动页困难') {
              // 获取问题记录本身文本， 获取写下的困难
              if (quesConStr === '') {
                oquesCon.innerHTML = localGet('questxt', 'string') ? localGet('questxt', 'string') : '';
              }
              let txtQues = toGet('.taskDifficult').value;
              let txtTitle = taskInput.value;
              if (type.indexOf('utools') === 0) {
                txtTitle = '';
                txtQues = type.slice(6);
              }
              omoreSections[num].classList.add('active');
              numOfSection = num;

              if (txtQues.trim() || txtTitle.trim()) {
                let str = oquesCon.innerHTML;
                str +=
                  `<br><div>${txtTitle.trim()?'事情：'+txtTitle.trim()+'</div><div>':''}问题：${txtQues.trim()?txtQues.trim():''}</div>`;
                oquesCon.innerHTML = str;
              }
              oquesConwrapper.scrollTo(0, oquesConwrapper.scrollHeight);
            }

          }
          omoreSections[num].classList.add('active');
          numOfSection = num;
          toGet('.morepart-notebox').setAttribute('data-type', '');
          if (num === 1 && osetting.classList.contains('active')) {
            settingOpen();
          }
          if (num === 2) { // 2链接互用 链接变动-修改  
            hotlinkload('use');
          }

          if (num === 4) {
            itemOpen(data);
            toGet('.morepart-notebox').setAttribute('data-type', '项目');
          }
          if (num === 5) { // 显示当前月份的内容
            if (data === '定期') {
              dcalendarType = 'special';
              let btns = ocalendarTypePart.querySelectorAll('.cbtn');
              btns[0].classList.remove('active');
              btns[3].classList.add('active');
            }
            chooseCalendarShow(dcalendarType);
            toGet('.morepart-notebox').setAttribute('data-type', '日历');
          }
        }
      }

      var oeasylinks = toGet('.easylink', true);

      function linknectShowFun() { // 展示
        var inputs = opartLinkUl.querySelectorAll('input');
        if (Object.keys(linkConnectObj).length > 0) {
          for (let i = 0; i < inputs.length; i++) {
            let x = i + '';
            if (linkConnectObj[x]) {
              let item = linkConnectObj[x];
              if (item.length >= 2) {
                inputs[i].setAttribute('placeholder', '(' + item[1] + ')');
              } else {
                inputs[i].setAttribute('placeholder', '(' + item[0] + ')');
              }
              // 处理下链接 
              oeasylinks[i].onclick = function() {
                toLink(item[0]);
              };
              oeasylinks[i].classList.add('active');
            } else {
              inputs[i].setAttribute('placeholder', '(未设置)');
              oeasylinks[i].classList.remove('active');
            }
          }
        } else {
          for (let i = 0; i < inputs.length; i++) {
            inputs[i].setAttribute('placeholder', '(未设置)');
            oeasylinks[i].classList.remove('active');
          }
        }
      }

      var ofunbtns = omorefunpart.querySelectorAll('.funbtns span');
      ofunbtns[0].onclick = function() { // 清空互用数据
        tellyouTip(tellO['delLinkConnect'], 'sure', '清空互用数据');
      }
      ofunbtns[1].onclick = easylinkSetFun;

      function easylinkSetFun(type = null) { // 确认修改 数据源 linkConnectObj
        const inputs = opartLinkUl.querySelectorAll('input');
        let quick = /^(?:http|https):\/\/[\S]+/.test(type) ? true : false;
        for (let i = 0; i < inputs.length; i++) {
          let x = i + '';
          if (quick) { // 快速加载
            if (inputs[i].getAttribute('data-name')) {
              linkConnectObj[x] = [type + inputs[i].getAttribute('data-name')];
              inputs[i].value = '';
            }
          } else { // 原本
            let val = inputs[i].value.trim();
            let num = val * 1;
            let itemlist = [];
            if (val !== '') {
              if (/^(?:http|https):\/\/[\S]+/.test(val)) { // 网址
                // itemlist[0] = val;
                linkConnectObj[x] = [val];
                inputs[i].value = '';
              } else if (!isNaN(num) && typeof num === 'number' && num < linkArr.length) { // 数字对应网址
                let r1 = /((?:http|https):\/\/[\S]+)"[\)）]+/;
                // log(linkArr[val]);
                if (window.utools && linkArr[val].indexOf('filelink link') !== -1) {
                  r1 = /([C-K]+:\\\\[\S]+)"[\)）]+/;
                }
                let r2 = /\>([\u4E00-\u9FA5A-Za-z0-9_-\|]+)\<\//;
                let olink = linkArr[val];
                if (r1.test(olink) && r2.test(olink)) {
                  itemlist[0] = r1.exec(olink)[1];
                  itemlist[1] = r2.exec(olink)[1];
                  linkConnectObj[x] = itemlist;
                  inputs[i].value = '';
                }

              }
            }
          }


        }
        dataObj['linkconnectObj'] = linkConnectObj;
        localSave('dataObj', dataObj, 'object');
        linknectShowFun();
      }



      window.onload = function() {
        if (!window.utools) { // 网站 => MD 自动保存 盯住 不显示
          // simplebtns[5].style.display = 'none';

          opopuptopbtn.style.display = 'none';
          toGet('.isSaveLocal').style.display = 'none';
          toGet('.tomatoPart').style.display = 'none';
          oisPlayAudio.style.display = 'block';
        } else {
          utools.onDbPull(() => {
            // 当此插件的数据在其他设备上被更改后同步到此设备时，uTools 将会主动调用这个方法
            tellyouTip(tellO['uSync'], 'sure', '同步');
          });
          n_topsize = 250;
          ourlInput.setAttribute('placeholder', '输入链接或文件夹路径');
          // ojumpbtns[1].classList.add('unshow');
          // ojumpbtns[2].classList.add('unshow');
        }

        var ithasData = localGet('collectSortBox', 'string') ? true : false;
        if (window.utools && !ithasData) {
          log('重启后数据丢失，自动同步');
          readUseData();
        } else {
          loadAgain('begin');
        }
      }


      if (window.utools) {
        utools.onPluginOut(() => { // 用户退出插件
          // utools.showNotification('退出来了');
          if (userDefined['saveLocalChose']) {
            synDataToLocal();
          }

        });
        utools.onPluginDetach(() => { // 插件被分离
          // simplebtns[5].style.display = 'none';
          omindmapbtn.setAttribute('data-status', '1');
          omindmapbtn.title = '插件分离状态下，思维导图的打开还需要手动激活下utools窗口';
        });
        utools.onPluginEnter(({
          code,
          type,
          payload
        }) => {
          window.scrollTo(0, 0);
          utools.setExpendHeight(660);
          // log(code, type, payload);
          if (taskPTime.value * 1 > 3 && taskSFTime.value && timeCount.totalMin) {
            var timestamp = getWorkTime('try'); // 已经工作了多久
            var t1 = timestamp / 60000;
            var t2 = timeCount.totalMin; // 计划用时
            // log(t1, t2);  
            if (t2 > t1) {
              balloonStart(timestamp);
            } else {
              timeCount.totalMin = 0;
              stopRunning('oover');
            }
          }

          if (type === 'over') { // ① 主输入框的文本输入，注意添加输入焦点-不管用？？

            if (/^tt[\d]*.*/.test(payload)) {
              utoolQuicker(0, payload.slice(2));
            } else if (/^[C-K]+:\\.*/.test(payload)) {
              utoolQuicker(4, payload);
            } else {
              utoolQuicker(3, payload);
              writebox.value = payload;
              if (owrite.style.display !== 'block') {
                writeLayer();
              }
            }

          } else if (type === 'files' && payload[0].isDirectory) { // ② 文件夹选中
            var fileobj = payload[0];
            utoolQuicker(4, fileobj.path, fileobj.name);
          }

          utools.setSubInput(({
            text
          }) => {
            if (/^tt.*/.test(text)) {
              if (utools.subInputBlur()) {
                utoolQuicker(0, text.slice(2));
              }
            } else if (/^ff.*/.test(text)) { // 标签管理
              utoolQuicker(1, text.slice(2));
            } else if (/[?？]+$/.test(text)) {
              utoolQuicker(3, text);
            } else if (/^[C-K]+:\\.*/.test(text)) {
              utoolQuicker(4, text);
            } else if (/^bb.*/.test(text)) {
              utoolQuicker(5, text.slice(2));
            } else if (/^rl.*/.test(text)) {
              utoolQuicker(6);
            }
            //  else if (/^ba.*/.test(text)) {
            //   utoolQuicker(7);
            // }
          }, '输入bb 计时tt 内搜ff 日历rl | 问题?');

        });
      }

      function utoolQuicker(option, data = null, filename = '') {
        //  0 启动计时tt， 1 启动内搜ff，2 打开签到qd  3记问题?  4文件夹路径链接  5输入bb
        // readyInterface(); // 设置，书写框，中间层，总结面板 主页
        if (option === 0) { // 启动计时tt
          tellyouTip(tellO['uCard'], 'totop', data);
        } else if (option === 1) { // 启动内搜ff
          readyInterface(true, true, false, true);
          if (utools.subInputBlur()) {
            if (numOfSection !== 1) {
              toMainSquare(1);
            }
            tosearchtag(data);
          }
        } else if (option === 2) { // 打开签到qd
          readyInterface(true, true, true, true);
          jumptoDakaFun();
          utools.setSubInputValue('');
        } else if (option === 3) { // 记录问题?
          readyInterface(true, false, false, true); // 设置，书写框，中间层，总结面板
          if (/[?？]+\s*$/.test(data)) {
            // 尾部带有问号写入问题记录
            if (numOfSection !== 3) {
              toMainSquare(3, '启动页困难', 'utools' + data);
            }
          }
          utools.setSubInputValue('');
        } else if (option === 4) { // 文件夹路径链接
          readyInterface(true, true, true, true);
          simplebtns[1].classList.contains('active') ? '' : toNewpart(0); // 打开资料页
          oaddBtn.classList.contains('active') ? '' : toLinkAdd(); // 打开输入
          ourlInput.value = data;
          onameInput.value = filename;
        } else if (option === 5) { // 输入bb
          readyInterface(true, true, true, true, true);
          if (utools.subInputBlur()) {
            osimpleWriteBox.focus();
            osimpleWriteBox.value = data;
          }
        } else if (option === 6) { // 打开日历签rl
          readyInterface(true, false, false, true); // 是否关闭：设置，书写框，中间层，总结面板
          if (utools.subInputBlur()) {
            if (numOfSection !== 5) {
              toMainSquare(5);
            }
            owriteCalendarIn.focus();
          }
        } else if (option === 7) {
          readyInterface(true, false, false, true); // 是否关闭：设置，书写框，中间层，总结面板
          if (utools.subInputBlur()) {
            if (numOfSection !== 0) {
              toMainSquare(0);
            }
          }
          utools.setSubInputValue('');
        }
      }

      function loadAgain(type = null) {
        if (type !== 'begin') {
          nowIsMainPage('load'); // 回主页
        }
        quesConStr = ''; // 使打开问题记录时加载数据
        txtData['itemHTML'] = oitemAllPeriod.innerHTML;
        userdefinedfun();
        dataObj = localGet('dataObj', 'object')? localGet('dataObj', 'object'):{};
        moveBasicData();
        
        badmoonRec(null);
        sortBoxStr = localGet('collectSortBox', 'string');

        hotlinkload();
        hotlinkload('use');
        linknectShowFun(); // 弹框中互用链接定义情况
        tolinkReferFun(); // 主页添加互用链接
        refreshfun();
        refreshDetailFun();
        isToNotice('get'); // 提醒否
        if (document.body.offsetWidth < 425 && !window.utools) {
          for (let ee = 0; ee < 5; ee++) {
            parts[ee].classList.add('noEdit');
          }
          aside.classList.add('noEdit');
          fllists[0].classList.add('noEdit');
          fllists[2].classList.add('noEdit');
          ocheckHeader.classList.remove('smaller');
        }

        if (noRefreshNote) {
          var oreferinput = toGet('.referinput');
          oreferinput.checked = true;
          asideToggle(oreferinput);
        }
        itemObj = localGet('itemObj', 'object') ? localGet('itemObj', 'object') : {};
        strToList(sortBoxStr); // 内部会执行 origin(); 
        // 先删
        everyDayDaka(); // 签到
        showNote(0); // 进程分析
        loadMemory(); // 记忆卡
        // 检查的完成清单和统筹，收集箱，问题，项目都是打开再加载的
        regularDetailFun();

        if (ojumpbtns[4].getAttribute('data-month') !== month) {
          ojumpbtns[4].setAttribute('data-month', month);
        }


        // 帮助页的过去日子计算  ---一天一次
        // year  date, week 
        var newyear = new Date(year + '/01/01');
        var dayfromyear = Math.floor((new Date().getTime() - newyear.getTime()) / 86400000) + 1;
        var opastDays = toGet('.pastDay', true);
        var aa = Math.ceil(dayfromyear / monthStaticList['all'] * 1000) / 10;
        var bb = Math.floor(date / monthStaticList[month] * 1000) / 10;
        var cc = Math.floor(week / 7 * 1000) / 10; // 
        if (cc == 0) {
          cc = 100;
        }
        opastDays[0].innerHTML = dayfromyear + '天 (<i class="circlePercent ' + (aa > 50 ? 'active' : '') +
          '"><b class="realPb" style="transform:rotate(' + (aa / 100) +
          'turn);" data-turn="rotate(' + (aa / 100) + 'turn);"></b></i>' + aa + '%)';
        opastDays[1].innerHTML = date + '天 (<i class="circlePercent ' + (bb > 50 ? 'active' : '') +
          '"><b class="realPb" style="transform:rotate(' + (bb / 100) +
          'turn);" data-turn="rotate(' + (bb / 100) + 'turn);"></b></i>' + bb + '%)';
        opastDays[2].innerHTML = (week === 0 ? '7' : week) + '天 (<i class="circlePercent ' + (cc > 50 ? 'active' : '') +
          '"><b class="realPb" style="transform:rotate(' + (cc / 100) +
          'turn);" data-turn="rotate(' + (cc / 100) + 'turn);"></b></i>' + cc + '%)';
        opastDays[3].innerHTML = opastDays[0].innerHTML;
        opastDays[4].innerHTML = opastDays[1].innerHTML;
        if (window.utools) {
          let isautoSave = userDefined['saveLocalChose'];
          if (!isautoSave) {
            tellyouTip(tellO['uSave'], 'sure', '开启保存');
          }
        } else {
          osimpleWriteBox.focus();
        }

        if (type === 'begin' && txtData['willOverdueTxt']) {
          toGet('.willOverdueTxt').innerText = `下个月会过期的有：${txtData['willOverdueTxt']}`;
          // log('begin-load again', txtData['willOverdueTxt']);
        }
      }

      function toNewPlugin() {
        if (window.utools) {
          utools.redirect('Markdown 笔记', '');
        }

      }
      // 首行menu的按钮 +笔记button
      var menuBtns = toGet('.circlebtn', true);
      menuBtns[0].onclick = function() {
        // 折叠或展开 => 双击回到顶部也可
        if (this.innerText === '展') {
          for (let i = 0; i < parts.length; i++) {
            parts[i].style.display = 'block';
            oheaders[i].setAttribute('data-id', '1');
            oheaders[i].querySelector('h2').classList.add('showing');
          }
          this.innerText = '叠';
        } else if (this.innerText === '叠') {
          for (let i = 0; i < parts.length; i++) {
            parts[i].style.display = 'none';
            oheaders[i].setAttribute('data-id', '0');
            oheaders[i].querySelector('h2').classList.remove('showing');
          }
          this.innerText = '展';
        }

      }
      var oasideBtns = toGet('.toRightBtn', true);
      var aside = toGet('.aside');
      oasideBtns[0].onclick = function() {
        getTime();
        if (omain.classList.contains('active')) {
          aside.style.display = 'block';
          omain.classList.remove('active');
        } else {
          aside.style.display = 'none';
          omain.classList.add('active');
        }
      }
      oasideBtns[1].onclick = function() { // 隐藏侧边栏 并确定哪个<
        getTime();
        if (omain.offsetWidth < 666) {
          omain.classList.add('active'); // 没有侧边栏
          omain.classList.add('fixed'); // 侧边栏目前是固定定位
          aside.classList.remove('fixed');
          aside.style.display = 'none';
        } else {
          aside.style.display = 'none';
          omain.classList.add('active');
          oasideBtns[0].innerHTML = '&lt;';
          if (aside.classList.contains('fixed')) {
            omain.classList.add('fixed');
          }
        }
      }
      oasideBtns[2].onclick = function() {
        getTime();
        if (aside.classList.contains('fixed')) {
          aside.classList.remove('fixed');
          omain.classList.remove('fixed');
          oasideBtns[2].title = '右侧栏完全显示出来';
        } else {
          aside.classList.add('fixed');
          omain.classList.add('fixed');
          oasideBtns[2].title = '右侧栏回归原位置';
        }
      }
      menuBtns[1].onclick = writeLayer; // 打开或关闭输入框
      var otowritebtn = toGet('.towritebtn');
      otowritebtn.onclick = writeLayer;
      var ototopbtn = toGet('.totopbtn');
      ototopbtn.onclick = function() {
        window.scrollTo(0, 0);
        // document.body.scrollTop = 0;
        opages.scrollIntoView(true);
      }
      ototopbtn.ondblclick = function(event) {
        // 双击折叠或展开
        let ele = event.target;
        let stat = ele.getAttribute('data-tab');
        if (stat === '展') {
          for (let i = 0; i < parts.length; i++) {
            parts[i].style.display = 'block';
            oheaders[i].setAttribute('data-id', '1');
            oheaders[i].querySelector('h2').classList.add('showing');
          }
          ele.setAttribute('data-tab', '叠');
        } else if (stat === '叠') {
          for (let i = 0; i < parts.length; i++) {
            parts[i].style.display = 'none';
            oheaders[i].setAttribute('data-id', '0');
            oheaders[i].querySelector('h2').classList.remove('showing');
          }
          ele.setAttribute('data-tab', '展');
        }
      }

      function writeLayer(type = null, itemsign = null) {
        menuBtns[5].classList.remove('active');
        menuBtns[10].classList.remove('active');
        menuBtns[20].classList.remove('active');
        if (menuBtns[5].innerText !== '加入随记') {
          menuBtns[5].classList.add('active');
        } else {
          menuBtns[5].title = '写入小本本，不支持多项添加(快捷键Alt+Enter)';
        }
        var status = menuBtns[1].getAttribute('data-open');
        if (status === '0') { // 显示框
          owrite.style.display = 'block';
          writebox.focus();
          menuBtns[1].classList.add('active');
          menuBtns[1].setAttribute('data-open', '1');
          if (itemsign) {
            writebox.value = '@' + itemsign + ' ';
            menuBtns[20].classList.add('active');
            writeboxTips.innerText = '收集箱添加多项含标志内容时，让@标志 写在开头（而其他清单达到同样效果还需要点击自动处理）';
          } else {
            writeboxTips.innerText = tipO['default'];
          }
          // if (menuBtns[2].getAttribute('data-open') === '0') {
          //   ohandstar.style.opacity = '0.1';
          // }
        } else if (type !== '刷新任务' && type !== '定期任务' && type !== '启动页自定义' && type !== '日期倒计时') { // 隐藏框
          menuBtns[1].setAttribute('data-open', '0');
          menuBtns[1].classList.remove('active');
          menuBtns[16].classList.add('set');
          menuBtns[16].innerText = txtData['searchCondition'];
          menuBtns[16].title = '去设置搜索范围';
          menuBtns[16].classList.remove('active');
          menuBtns[20].style.display = 'block';
          owrite.style.display = 'none';
          writebox.removeAttribute('data-val'); // 关闭时要去掉切换需要保存的值
          writebox.removeAttribute('data-num'); // 关闭时要去掉切换状态值
          // 隐藏按钮
          let btns = owrite.querySelectorAll('.btns .circlebtn');
          btns[3].classList.add('edit');
          btns[3].classList.remove('active');

          btns[2].innerText = '加入随记';
          writebox.value = '';
          tmpValue = null;
          tmpNode = null;

          // if (menuBtns[2].getAttribute('data-open') === '0') {
          //   ohandstar.style.opacity = '1';
          // }
        }
        if (type === '刷新任务' || type === '定期任务' || type === '日期倒计时') {
          menuBtns[20].style.display = 'none';
          if (type === '刷新任务') {
            odorefreshtask.classList.add('active');
          } else {
            odorefreshtask.classList.remove('active');
          }
          orefreshbtn.classList.add('active');
          menuBtns[5].innerText = '加入随记';
          menuBtns[5].classList.remove('active');
        } else {
          orefreshbtn.classList.remove('active');
          odorefreshtask.classList.remove('active');
        }
      }

      function switchWrite(type) {
        if (type === '1') { // 1-书写框
          writeLayer();
          writebox.value = osimpleWriteBox.value;
          osimpleWriteBox.value = '';
          writebox.focus();
        } else if (type === '11') { // 11-书写框
          if (menuBtns[1].getAttribute('data-open') === '0') {
            writeLayer();
          }
          writebox.value = writeBoxForCopy.value;
          writebox.focus();
        } else if (type === '0') { // 0-主页
          osimpleWriteBox.value = writebox.value;
          writeLayer();
          osimpleWriteBox.focus();
        } else if (type === '2') { // 2-简版页
          writeBoxForCopy.value = writebox.value;
          writeLayer();
          if (simplebtns[0].getAttribute('data-name') === '切简版') {
            toSimplePart();
          }
          if (oopenInoutBtn.innerText === '显') {
            openInoutWrite();
          }
          writeBoxForCopy.focus();
        }
      }

      var hasopenSidebox = 0;
      menuBtns[2].onclick = summPartToggle;

      function summPartToggle() { // 开启或关闭总结面板
        var status = menuBtns[2].getAttribute('data-open');
        if (status === '0') {
          floor.style.display = 'block';
          menuBtns[2].classList.add('active');
          menuBtns[2].setAttribute('data-open', '1');
          // document.body.style.overflow = 'hidden';
          oasidemenu.classList.add('hidding');
          menuBtns[0].classList.add('unshow');
          // ohandstar.style.opacity = '0';
          if (omorefunpart.classList.contains('open')) {
            omorefunpart.classList.remove('open');
            hasopenSidebox = 1;
          }
        } else {
          floor.style.display = 'none';
          menuBtns[2].setAttribute('data-open', '0');
          menuBtns[2].classList.remove('active');
          // document.body.style.overflow = 'auto';
          oasidemenu.classList.remove('hidding');
          menuBtns[0].classList.remove('unshow');
          // if (owrite.style.display === 'block') {
          //   ohandstar.style.opacity = '0.1';
          // } else {
          //   ohandstar.style.opacity = 'unset';
          // }
          if (hasopenSidebox) {
            omorefunpart.classList.add('open');
            hasopenSidebox = 0;
          }
        }
      }

      // 总结面板的内容
      var floor = toGet('.upfloor');
      var flcheckeds = floor.querySelectorAll('input');
      var oanalyzeCon = floor.querySelector('.analyzeCon');
      var fllists = document.querySelectorAll('.analyzeCon .list');
      // var oflstatus = floor.querySelector('.controlers');

      for (let j = 0; j < flcheckeds.length; j++) {
        flcheckeds[j].onclick = function() {
          let status = oanalyzeCon.getAttribute('data-num');
          if (flcheckeds[j].checked) {
            fllists[j].style.display = 'block';
            status++;
          } else {
            fllists[j].style.display = 'none';
            status--;
          }
          oanalyzeCon.setAttribute('data-num', status);
          if (status === 3) {
            oanalyzeCon.classList.remove('canbig');
          } else {
            oanalyzeCon.classList.add('canbig');
          }
        }
      }

      var osetting = toGet('.setting');
      var osettingpart = toGet('.settingpart');

      var osettingback = toGet('.settingback');
      var osettingbtn = toGet('.settingbtn');
      osettingback.onclick = settingOpen;
      osettingbtn.onclick = settingOpen;
      var oasidemenu = toGet('.asidemenu');

      function settingOpen() { // 打开设置页面
        let scroll = 0;
        let element = null;
        // 禁止主部分移动
        let val = osettingbtn.getAttribute('data-val');
        if (val === '1') { // 显示
          osetting.classList.add('active');
          osettingbtn.classList.add('active');
          osettingbtn.setAttribute('data-val', '0');
          osettingbtn.setAttribute('data-n_newpartshow', n_newpartshow);
          isOpenSetting = true;
          if (n_newpartshow < 0) {
            document.body.classList.add('set');
            scroll = document.documentElement.scrollTop || document.body.scrollTop || 0;
          } else {
            element = oshowings[n_newpartshow];
            scroll = window.scrollY || opages.scrollTop || 0;
            if (n_newpartshow !== 1) {
              scroll = scroll - 52;
            }
            element.style.position = 'fixed';
            element.style.top = '-' + scroll + 'px';
          }
          osettingbtn.setAttribute('data-scroll', scroll);

        } else { // 隐藏
          osetting.classList.remove('active');
          osettingbtn.classList.remove('active');
          osettingbtn.setAttribute('data-val', '1');
          osearchModeline.classList.remove('active');
          toGet('.issearchRecord').classList.remove('active');
          let scrollnum = osettingbtn.getAttribute('data-scroll') * 1;
          isOpenSetting = false;
          let truepart = osettingbtn.getAttribute('data-n_newpartshow') * 1;
          if (n_newpartshow < 0) { // 去主页
            if (truepart !== n_newpartshow) { // 其他页-》主页
              oshowings[truepart].style = 'display:none;';
            } else { // 主编辑页和简版切换 
              document.body.classList.remove('set');
              window.scrollTo(0, scrollnum);
            }
          } else if (n_newpartshow > -1) { // 去其他页
            if (truepart === n_newpartshow) { // 没动
              oshowings[truepart].style = 'display:block;';
              let ischange = osettingbtn.getAttribute('data-change');
              if (ischange && ischange === '1') {
                scrollnum = -52;
                osettingbtn.setAttribute('data-change', '0')
              }
              if (n_newpartshow !== 1) {
                window.scrollTo(0, scrollnum + 52);
              } else {
                window.scrollTo(0, scrollnum);
              }
            } else if (truepart < 0) { // 动了-主页到其他页
              document.body.classList.remove('set');
              window.scrollTo(0, 0);
            } else { // 动了-其他页到其他页
              oshowings[truepart].style = 'display:none;';
            }
          }
        }
      }

      // 反向
      var concheckeds = document.querySelectorAll('.mainpart .controlers input');
      for (let j = 0; j < concheckeds.length; j++) {
        concheckeds[j].onclick = function() {
          var num = solvedBtns[j].getAttribute('data-num') ? solvedBtns[j].getAttribute('data-num') * 1 : 0;
          var totalnum = thingsNums[j].innerText * 1;
          if (j === 0) {
            selectReverse(dolist);
          } else if (j === 1) {
            selectReverse(daylist);
          } else if (j === 2) {
            selectReverse(waitlist);
          }
          if (totalnum !== num) {
            solvedBtns[j].setAttribute('data-num', totalnum - num);
            solvedBtns[j].classList.add('active');
          } else {
            solvedBtns[j].setAttribute('data-num', 0);
            solvedBtns[j].classList.remove('active');
          }
        }
      }

      function selectReverse(obj) {
        var items = obj.querySelectorAll('b');
        var checkeds = obj.querySelectorAll('input');
        for (let k = 0; k < checkeds.length; k++) {
          if (checkeds[k].checked) {
            checkeds[k].checked = false;
            if (items[k].classList.contains('finish')) {
              items[k].classList.remove('finish');
              items[k].parentElement.classList.remove('finish');
            }
          } else {
            checkeds[k].checked = true;
            items[k].classList.add('finish');
            items[k].parentElement.classList.add('finish');
          }
        }

      }
      menuBtns[3].onclick = function() { // 清空
        writeboxTips.innerText = tipO['default'];
        // 清空切换的各种状态
        writebox.removeAttribute('data-val'); // 关闭时要去掉切换需要保存的值
        writebox.removeAttribute('data-num'); // 关闭时要去掉切换状态值
        inputDeleteFun(writebox);
      }

      function inputDeleteFun(inputbox) {
        var val = inputbox.value.trim();
        var noelse = true;
        if (val.indexOf('@急') !== -1 || val.indexOf('@重') !== -1) {
          val = val.replace(/[\s]?@急/g, '');
          val = val.replace(/[\s]?@重/g, '');
          noelse = false;
        }
        if (regexDate.test(val)) {
          val = val.slice(0, -10);
          noelse = false;
        }
        if (noelse) {
          inputbox.value = '';
        } else {
          inputbox.value = val;
        }
        inputbox.focus();
      }
      menuBtns[4].onclick = quickTodo; // 快速添加
      function quickTodo() {
        var val = writebox.value.trim();
        if (val && !/[$\^&]/.test(val)) {
          let list = addToList(val, 'dolist');
          if (list.length !== 0) {
            saveData();
            getNum(list);
            beforeData['tmpDolist'] = list;
            localSave('dolist', list.join('*'));
            datasolve(list, dolist);
            changeFinishProgress();
          }
          if (tempInputWrong.length !== 0) {
            writeboxTips.innerText = tipO['wrongurl'];
            tempInputWrong = [];
          } else {
            writeboxTips.innerText = tipO['successDo'];
          }
        } else {
          writeboxTips.innerText = tipO['character'];
        }
        writebox.focus();
      }

      menuBtns[5].onclick = inputDataSet;
      var tempInputWrong = [];

      function addToList(val, type) {
        tempInputWrong = [];
        let lis = [];
        let isIllegal = false;
        let oUl = solveUl;
        if (type === 'dolist') {
          oUl = dolist;
        }
        if (type === 'checkList') {
          oUl = places[0];
        }
        if (/\*+/.test(val)) { // 多项添加 *分隔
          lis = val.trim().split('*');
        } else {
          lis[0] = val;
        }

        let index = oUl.querySelectorAll('li').length;
        for (let i = 0; i < lis.length; i++) {
          let finalVal = lis[i].trim();
          if (finalVal) {
            var valResult = isSaveItem(finalVal);
            if ((valResult && isNowALink) || (valResult && !/toLink/.test(valResult))) {
              if (type === 'testItemID' && /\s@[a-z-_0-9]+$/g.test(finalVal)) {
                let temp = /\s@([a-z-_0-9]+)$/g.exec(finalVal);
                let itemid = temp ? temp[1] : null;
                if (itemid && existItemArr.indexOf(itemid) !== -1 || itemid && filedArr.indexOf(itemid) !== -
                  1) { // 已存在的编号失效
                  let idx = valResult.lastIndexOf('@');
                  finalVal = valResult.slice(0, idx);
                  tellyouTip(`【注意】项目项已添加，但项目编号添加失败！（因为项目编号${itemid}已存在）`, 'tip');
                } else {
                  finalVal = valResult;
                }

              } else {
                finalVal = valResult;
              }
            } else {
              tempInputWrong.push(finalVal);
              isIllegal = true;
              continue;
            }
            let liItem =
              '<label><input type="checkbox" value=""/><span class="cbox" onclick="checkIt(event)"></span><b class="item"  onclick="checkIt(event)">' +
              finalVal +
              '</b></label><div class="smallcontrol"><span class="writebtn line" onclick="lineEdit(event)"></span><span class="deletebtn line" onclick="lineDelete(event)">×</span></div>';

            let li = document.createElement('li');
            li.setAttribute('data-id', index + i);
            li.innerHTML = liItem;
            oUl.appendChild(li);

            if (solveUl == daylist && valResult && isNowALink && regexDate.test(valResult)) {
              writeboxTips.innerText = tipO['warnDayLink'];
            }
          }
        }

        if (isIllegal) {
          writebox.value = tempInputWrong.join('*');
        } else {
          writebox.value = '';
        }
        if (type === 'dolist') {
          let list = getList(oUl);
          beforeData['tmpDolist'] = list;
          return list;
        } else if (type === 'checkList') {
          let list = getList(oUl);
          return list;
        } else {
          let classname = oUl.getAttribute('class');
          findList(classname);
        }

      }

      var osimpleWriteBox = toGet('.simpleWriteBox');
      var obuttonline = toGet('.buttonline');
      obuttonline.onclick = function(e) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'INPUT') {
          ele = ele.parentElement;
        }
        if (ele.tagName === 'LABEL') {
          var index = ele.getAttribute('data-index') * 1;
          ele.parentElement.setAttribute('data-index', index);
          osimpleWriteBox.focus();  
        }
        if (ele.tagName === 'U') {
          toNewpart(3, 'review', 3);
        }
      }
      var otoknewbtn = document.querySelector('.rightside .toknewbtn'); // 收集箱的问号box
      otoknewbtn.onclick = function() {
        toMainSquare(0);
        if (n_newpartshow === 3) { // 帮助页已打开
          var olis = obookmenu.getElementsByTagName('li');
          olis[txtpartshow].classList.remove('active');
          txtparts[txtpartshow].classList.remove('active');
          olis[2].classList.add('active');
          txtparts[2].classList.add('active');
          txtpartshow = 2;
          window.scrollTo(0, 0);
        } else {
          toNewpart(3, 'question', 2);
        }
      }
      var osearchControl = toGet('.searchControl');
      var otopInput = toGet('.topInput');
      osearchControl.onclick = function(e) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        var ospans = osearchControl.getElementsByTagName('span');
        if (ele.tagName === 'SPAN') {
          var index = ele.getAttribute('data-id');
          // otopInput.classList.add('searching');
          var val = osimpleWriteBox.value;
          if (index === '2') {
            toMainSquare(1);
            if (val) {
              tosearchtag(val);
            }
          } else if (index === '1') {
            webSearchFun('mainpart');
          }

        }
      }

      osimpleWriteBox.onkeydown = function(e) {
        var event = e || window.event;
        if (event.keyCode === 13) {
          var val = osimpleWriteBox.value;
          if (/^(a|b|w1|w2|g1|g2|g3)\s/.test(val.trim())) {
            webSearchFun('mainpart');
          } else {
            var index = obuttonline.getAttribute('data-index') * 1;
            if (index < 6) {
              inputDataSet(index);
            } else {
              if (/^@[a-z-_\u4e00-\u9fa5]+\s/.test(val)) {
                let pre = val.slice(0, val.indexOf(' '));
                inputcollect(null, pre);
              } else {
                inputcollect();
              }
            }
            osimpleWriteBox.focus();
          }

        }
      }

      var otagsearch = toGet('.tagsearch');
      var otagmakebtn = toGet('.tagmakebtn');
      var otagmenu = toGet('.tagmenu');
      var otagmenudecor = toGet('.tagmenudecor');
      var otagConwrapper = toGet('.tagCon-wrapper');
      var tagUls = toGet('.tagContent ul', true);
      otagsearch.onkeydown = function(e) {
        var event = e || window.event;
        var val = otagsearch.value;
        if (event.keyCode == 13) {
          // 实现标签搜索功能
          tosearchtag(val);
        }
      }
      toGet('.tagtxtDelBtn').onclick = function() {
        otagsearch.value = '';
      }

      function tosearchtag(things) {
        otagsearch.focus();
        let finalfind = things;
        let type = 'txt';
        let [list00, list11, list22, list33] = [
          [],
          [],
          [],
          []
        ];
        let searchRecord = false;
        let itemidFind = false;

        if (finalfind === '#全部') {
          finalfind = '';
        } else if (finalfind === '#今天') {
          // 加上五个清单项和开启的刷新任务

          [list00, list11, list22, list33] = datatagsolve(today, 'today');
          type = 'date';
          finalfind = todayAdd;
        } else if (finalfind === '#记忆') {
          type = 'justmemory';
          finalfind = '';
        } else if (finalfind === '本本') {
          finalfind = '「本本」';
        } else if (finalfind === '收藏') {
          [list00, list11, list22, list33] = datatagsolve('「链接」');
          finalfind = '「参考」';
        } else if (finalfind === '搜索记录') {
          finalfind = '';
          searchRecord = true;
        } else if (finalfind.indexOf('@@') === 0) {
          let trueitem = finalfind.slice(2);
          existItemArr = localGet('existItem', 'object') ? localGet('existItem', 'object') : ['模板'];
          if (existItemArr.indexOf(trueitem) !== -1) {
            itemidFind = true;
          }
        } else {
          if (regexDate.test(finalfind)) {
            let tmpdate = finalfind.replace(/[-]+/g, '/');
            [list00, list11, list22, list33] = datatagsolve(tmpdate);
            type = 'date';
          }
        }
        otagsearch.value = finalfind;
        if (searchRecord) { // 搜索记录
          // recordSearchStr = localGet('searchData', 'string')?localGet('searchData','string'):'';
          let txt = recordSearchStr ? recordSearchStr.replace(/\^/g, '\n') : '';
          if (odownloadnowbtn.innerText === '编辑模式') {
            isTagEditshow();
          }
          otagDownCon.innerText = txt ? '【搜索记录】 搜索位置：内容' + txt : '暂无搜索记录';
          if (!userDefined['recordSearchChose']) {
            tellyouTip(tellO['openRecord'], 'sure', '开启记录');
          }
        } else if (itemidFind) {
          let itemid = finalfind.slice(2);
          let title = itemObj[itemid][3] ? itemObj[itemid][0] + itemObj[itemid][3] : itemObj[itemid][0];
          let tip = itemObj[itemid][2] ? itemObj[itemid][2] : '';
          let obj = itemObj[itemid][1] ? itemObj[itemid][1] : {};
          let txt1 = '## ' + title + ' \n' + tip + '\n';
          for (let item in obj) {
            let obbj = obj[item][1];
            txt1 = txt1 + '### ' + obj[item][0] + '\n> plan(' + obbj['plan'].length + ')\n';
            let txt2 = obbj['plan'].length > 0 ? '- ' + obbj['plan'].join('\n- ') + '\n' : '';
            txt1 = txt1 + txt2 + '> todo(' + obbj['todo'].length + ')\n';
            let txt3 = obbj['todo'].length > 0 ? '- ' + obbj['todo'].join('\n- ') + '\n' : '';
            txt1 = txt1 + txt3 + '> done(' + obbj['done'].length + ')\n';
            let txt4 = obbj['done'].length > 0 ? '- ' + obbj['done'].join('\n- ') + '\n\n' : '\n';
            txt1 = txt1 + txt4;
          }
          if (odownloadnowbtn.innerText === '编辑模式') {
            isTagEditshow();
          }
          otagDownCon.innerText = txt1;
        } else {
          var [list0, list1, list2, list3] = datatagsolve(finalfind, type);
          if (type === 'date' || finalfind === '「参考」') {
            list0 = list0.concat(list00);
            list1 = list1.concat(list11);
            list2 = list2.concat(list22);
            list3 = list3.concat(list33);
          }
          if (finalfind === '「参考」') {
            otagsearch.value = '';
          }
          datatagshow(list0, tagUls[0]);
          datatagshow(list1, tagUls[1]);
          datatagshow(list2, tagUls[2]);
          datatagshow(list3, tagUls[3]);
          if (odownloadnowbtn.innerText === '查看模式') {
            otagDownCon.innerText = tagdownloadEdit();
          }
        }
        tojumptagmenu('0');
      }

      function datatagshow(list, obj) {
        let str = '';
        for (let m = 0; m < list.length; m++) {
          str += '<li>' + list[m] + '</li>';
        }
        obj.innerHTML = str;
      }
      otagmakebtn.onclick = function() {
        let val = otagsearch.value.trim();
        if (val && /[^|]+$/.test(val)) {
          var tmp = isSaveItem(val);
          if (tmp && !isNowALink) {
            tagArr.push(tmp);
            dataObj['taglist'] = tagArr;
            localSave('dataObj', dataObj, 'object');
            showCustomize(tagArr, 'tag', otagstatus);
          }
        }
      }
      otagmenu.onclick = function(event) {
        let ele = event.target || event.srcElement;
        if (ele.tagName === 'LI') {
          let index = ele.getAttribute('data-menu');
          tojumptagmenu(index);
        }
      }

      function tojumptagmenu(index) {
        let oldindex = otagmenu.getAttribute('data-menu');
        let lis = otagmenu.querySelectorAll('li');
        lis[oldindex].classList.remove('active');
        otagmenu.setAttribute('data-menu', index);
        lis[index].classList.add('active');
        if (index === '1') {
          otagmenudecor.className = 'tagmenudecor off';
        } else if (index === '0') {
          otagmenudecor.className = 'tagmenudecor';
        } else {
          otagmenudecor.className = 'tagmenudecor task';
        }
        let top = tagUls[index].offsetTop - 50;
        otagConwrapper.scrollTop = top; // 此处的top的值是数值
      }
      var ocollectUl = toGet('.collectUl');
      var osavecollectbtn = toGet('.savecollectbtn');
      var oclassifybtn = toGet('.classifybtn');
      var ocardecor = toGet('.cardecor');
      var ocollectGuide = toGet('.collectGuide');
      var nowSolveList = 0;
      osavecollectbtn.onclick = datacollectSave;

      function datacollectSave() {
        // 存数据 （总数计算 序列排列）
        let list = getList(ocollectUl);
        datacollectbox = list;
        localSave('collect', datacollectbox, 'object');
        datacollectshow(datacollectbox, ocollectUl); // 为了让序号生效 总数计算
        tempcheckcountnum = 0;
        ocollectPnums[1].innerHTML = tempcheckcountnum;
      }
      oclassifybtn.onclick = collectsolveFun;
      ocardecor.onclick = collectsolveFun;

      function collectsolveFun() {
        datacollectbox = solveAll(ocollectUl); // 剩下的项的数组
        localSave('collect', datacollectbox, 'object');
        if (datacollectchange.length > 0) {
          datacollectshow(datacollectbox, ocollectUl);
          // 待处理的数组  datacollectchange
          nowSolveList = ocollectGuide.getAttribute('data-num') * 1;
          let name = datalist[nowSolveList];
          findList(name);
          // debugger
          if (nowSolveList < 5) {
            inputDataSet(-2, 'solve', datacollectchange.join('*'));
          } else if (nowSolveList === 5) { // 参考资料
            beforeData.tmpReference = beforeData['tmpReference'].concat(datacollectchange);
            saveData();
            datashow(beforeData.tmpReference, reference);
          } else if (nowSolveList === 6) { // 回收箱
            beforeData.tmpRecycle = datacollectchange.concat(beforeData['tmpRecycle']);
            saveData();
            datasimpleshow(beforeData.tmpRecycle, recycle);
          }
        }
        ocollectPnums[1].innerText = '0';
        tempcheckcountnum = 0;
      }
      ocollectGuide.onclick = function(e) {
        var ele = e.target || e.srcElement;
        if (ele.tagName === 'INPUT') {
          ele = ele.parentElement;
        }
        if (ele.tagName === 'LABEL') {
          var labels = ocollectGuide.getElementsByTagName('label');
          let list = [5, 6, 4, 3, 0, 1, 2];
          let old = list[nowSolveList * 1];
          labels[old].classList.remove('active');
          nowSolveList = ele.getAttribute('data-num');
          ocollectGuide.setAttribute('data-num', nowSolveList);
          let newone = list[nowSolveList * 1];
          labels[newone].classList.add('active');
        }
      }

      function inputcollect(type, pre = null) {
        let list = [];
        var name = '';
        if (type === 'writebox') {
          var val = writebox.value.trim();
        } else {
          var val = osimpleWriteBox.value.trim();

        }
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
          name = 'red';
        }

        val = isSaveItem(val, null);
        if ((val && isNowALink) || (val && !/toLink/.test(val))) {
          if (/\*/.test(val)) {
            if (pre) {
              val = val.replace(/\*/g, '*' + pre + ' ');
            }
            list = val.split('*');
          } else {
            list[0] = val;
          }
          datacollectbox = list.concat(datacollectbox);
          localSave('collect', datacollectbox, 'object');
          solveUl = ocollectUl;
          nowlistStr = 'collectUl';
          // 用findList(name)能找到上面两个，name从元素ul的classname获取
          ocollectPnums[0].innerText = datacollectbox.length;
          datacollectshow(datacollectbox, ocollectUl);
          name = 'green';
          if (type === 'writebox') {
            writebox.value = '';
            writeboxTips.innerText = tipO['successCollect'];
          } else {
            osimpleWriteBox.value = '';
          }
        } else {
          name = 'red';
        }

        if (type !== 'writebox') {
          osimpleWriteBox.classList.add(name);
          setTimeout(function() {
            osimpleWriteBox.classList.remove(name);
          }, 2000);
        }
      }

      function inputDataSet(model, type, data = null) {
        // model = 012345 
        var val = '';
        var isopen = false;
        var name = '';
        // 确定处理的内容
        if (model > -1) {
          val = osimpleWriteBox.value.trim();
          isopen = true;
          if (model == 5) { // model=5
            nowlistStr = 'summaryList';
            solveUl = places[2];
            if (data) {
              val = data;
            }
          } else { // model=01234
            var classname = datalist[model];
            findList(classname);
          }
        } else if (data) {
          val = data;
        } else {
          val = writebox.value.trim();
        }
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
          name = 'red';
        }


        if ((menuBtns[5].innerText === '添加项*' && val) || (model < 5 && val) || (val && type === 'solve')) {
          if ((menuBtns[5].innerText === '添加项*' && val && solveUl === project) || (model === 3 && val)) {
            addToList(val, 'testItemID');
          } else {
            addToList(val);
          }
          let list = getList(solveUl);
          if (list.length !== 0) {
            beforeData[nowlistStr] = list;
            saveData();
            if (nowlistStr === 'tmpDolist' || nowlistStr === 'tmpDaylist' || nowlistStr === 'tmpWaitlist') {
              getNum(list);
              datasolve(list, solveUl);
              var solvedBtn = solveUl.parentElement.parentElement.querySelector('.solvedBtn');
              solvedBtn.setAttribute('data-num', 0);
              solvedBtn.classList.remove('active');
              var sortBtn = solveUl.parentElement.parentElement.querySelector('.sortBtn');
              sortBtn.classList.remove('active');
            }
            if (nowlistStr === 'tmpProject' || nowlistStr === 'tmpMaylist') {
              datashow(list, solveUl);
            }
            if (nowlistStr === 'tmpDaylist') {
              outOfTime();
            }
            if (nowlistStr === 'tmpDolist') {
              localSave('dolist', list.join('*'));
            }
            changeFinishProgress();
            if (tempInputWrong.length !== 0) {
              writeboxTips.innerText = tipO['warnLink'];
              tempInputWrong = [];
              name = 'red';
            } else {
              writeboxTips.innerText = tipO['successAdd'];
              name = 'green';
            }
            if (!model > -1) {
              writebox.focus();
            }
          }

        } else if (val) {
          val = isSaveItem(val, null);
          if ((val && isNowALink) || (val && !/toLink/.test(val))) {
            let isDone = true;
            if (menuBtns[5].innerText === '加入随记' || model === 5) {
              beforeData.summaryList[beforeData.summaryList.length] = val;
              // localSave('summarylist', beforeData.summaryList, 'object');
              datasimpleshow(beforeData.summaryList, places[2]);
              writebox.value = '';
              writeboxTips.innerText = tipO['successNote'];
              name = 'green';
              if (model !== 5 && type !== 'morewritebox') {
                writebox.focus();
              }
            } else if (menuBtns[5].innerText === '确定修改') {
              menuBtns[1].setAttribute('data-open', '1');
              // 确定修改 需要获取当前列表 修改项 修改内容val
              var temp = val;
              if (tmpNode) {
                if (isNowALink) {
                  temp = linkSolved(val, 'resetLink');
                }

                let classname = solveUl.getAttribute('class');
                findList(classname);

                if (nowlistStr !== 'tmpProject') {
                  tmpNode.innerHTML = temp;
                  tmpNode.style.color = '#2cb221';
                  beforeData[nowlistStr][changeId] = temp;
                  writebox.value = '';
                  writeLayer();
                } else {
                  isDone = false;
                  let isOriginSave = false;
                  let finalVal = temp;
                  let item = /\s@([a-z-_0-9]+)$/g.exec(temp);
                  let itemid = item ? item[1] : null;
                  let oldid = tmpNode.parentElement.getAttribute('data-sign');

                  if (itemid && existItemArr.indexOf(itemid) !== -1 || itemid && filedArr.indexOf(itemid) !== -
                    1) {
                    // 新改的编号已存在 - 重修修改
                    if (!(oldid && itemid == oldid)) {
                      let idx = temp.lastIndexOf('@');
                      finalVal = temp.slice(0, idx);
                      if (oldid) {
                        finalVal = finalVal.trim() + ' @' + oldid;
                      }
                      writebox.value = finalVal;
                      tellyouTip(
                        `由于目前项目编号${itemid}已存在（无法更改），输入框已${oldid?'还原为原来编号':'删除该编号'}${oldid?oldid:''}，请重新修改！`, 'tip');
                    } else { // 项目项只修改标题
                      isOriginSave = true;
                    }

                  } else if (itemid && oldid) {
                    // itemid为新编号 项目修改编号
                    tmpValue = finalVal;
                    tellyouTip(
                      `【提示】项目编号由 ${oldid} 变为 ${itemid}，原来该项目关联的内容将失去关联(数据还在)${itemObj[itemid]?'。\n此次新输入的编号还存在着以前的数据(不想要的话需要先在设置面板上清除项目失效数据)':''}，确定修改？`,
                      'sureitem', oldid);
                  } else if (oldid && !itemid) {
                    tmpValue = finalVal;
                    tellyouTip(`【提示】此操作会删除项目编号 ${oldid}并失去原本关联的内容，确定修改？`, 'sureitem', oldid);
                  } else if (itemid && !oldid && itemObj[itemid]) {
                    tmpValue = finalVal;
                    tellyouTip(`【提示】检查到新增的项目编号 ${itemid} 存在着以前的数据，确定修改？`, 'sureitem', '不修改');
                  } else {
                    isOriginSave = true;
                  }
                  if (isOriginSave) {
                    beforeData['tmpProject'][changeId] = finalVal;
                    datashow(beforeData.tmpProject, project);
                    tmpNode = null;
                    tmpValue = null;
                    writebox.value = '';
                    writeLayer();
                    saveData();
                  }
                }

              } else {
                writeboxTips.innerText = tipO['errorObj'];
              }
              if (nowlistStr === 'tmpDaylist') {
                outOfTime();
              }
              if (nowlistStr === 'tmpDolist') {
                localSave('dolist', beforeData['tmpDolist'].join('*'));
              }
            }
            if (isDone) {
              saveData(1);
            }
          } else {
            writeboxTips.innerText = tipO['wrongurl'];
            name = 'red';
          }
        }
        var boxtoWrite = null;
        if (model > -1) {
          boxtoWrite = osimpleWriteBox;
        }
        if (type === 'morewritebox') {
          boxtoWrite = omorewritebox;
        }
        if (model > -1 && name) {
          boxtoWrite.classList.add(name);
          if (name === 'green') {
            boxtoWrite.value = '';
          } else {
            boxtoWrite.value = boxtoWrite.value + ' (注意删除字符$^&) ';
          }
          setTimeout(function() {
            boxtoWrite.classList.remove(name);
          }, 2000);
        }
      }



      function getNum(list) { // 未完成事件数量
        // 事件数的计算 表的更新
        let num = list.length;
        if (nowlistStr === 'tmpDolist') {
          thingsNums[0].innerText = num;
        } else if (nowlistStr === 'tmpDaylist') {
          thingsNums[1].innerText = num;
        } else if (nowlistStr === 'tmpWaitlist') {
          thingsNums[2].innerText = num;
        }
      }
      menuBtns[6].onclick = function() { // 标红修改
        menuBtns[1].setAttribute('data-open', '1');
        var val = writebox.value.trim();
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
        }
        if (val) {
          val = isSaveItem(val, null);
          if ((tmpNode && val && isNowALink) || (tmpNode && val && !/toLink/.test(val))) {
            let temp = val;
            if (isNowALink) {
              temp = linkSolved(val, 'resetLink');
            }
            tmpNode.innerHTML = temp;
            tmpNode.style.color = '#fa4848';
            tmpNode = null;
            tmpValue = null;
            let classname = solveUl.getAttribute('class');
            findList(classname);

            beforeData[nowlistStr][changeId] = temp;
            if (nowlistStr === 'tmpDaylist') {
              outOfTime();
            }
            if (nowlistStr === 'tmpDolist') {
              localSave('dolist', beforeData['tmpDolist'].join('*'));
            }
            saveData(1);
            // writebox.value = '';
            writeLayer();
          } else {
            writeboxTips.innerText = tipO['wrongurl'];
          }
        }
      }

      menuBtns[7].onclick = function() { // 参考资料
        var val = writebox.value.trim();
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
        }
        if (val) {
          val = isSaveItem(val, null);
          if ((val && isNowALink) || (val && !/toLink/.test(val))) {
            beforeData.tmpReference[beforeData.tmpReference.length] = val;
            saveData();
            datashow(beforeData.tmpReference, reference);
            writeboxTips.innerText = tipO['successRefer'];
            writebox.value = '';
          } else {
            writeboxTips.innerText = tipO['wrongurl'];
          }
        }
        writebox.focus();
      }

      menuBtns[8].onclick = function() { // 检查卡
        var val = writebox.value.trim();
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
        }
        if (val) {
          let lis = addToList(val, 'checkList')
          if (lis.length !== 0) {
            beforeData.checkList = lis;
            datasimpleshow(beforeData.checkList, places[0]);
            localSave('checklist', beforeData.checkList, 'object');
          }
          if (tempInputWrong.length !== 0) {
            writeboxTips.innerText = tipO['warnLink'];
            tempInputWrong = [];
          } else {
            writeboxTips.innerText = tipO['successCheck'];
          }
        }
        writebox.focus();
      }

      menuBtns[9].onclick = function() { // 记忆单的保存
        var val = writebox.value.trim();
        if (val && /[$\^&]/.test(val)) {
          writeboxTips.innerText = tipO['character'];
          val = false;
        }
        if (val) {
          getTime();
          val = isSaveItem(val, null);
          var tip = '（记忆项添加成功！）';
          var regex = /记忆项添加成功/g;
          if ((val && !regex.test(val) && isNowALink) || (val && !regex.test(val) && !/toLink/.test(val))) {
            if (omemory[todayAdd]) {
              omemory[todayAdd] = omemory[todayAdd] + '~' + val;
            } else {
              omemory.origin = todayAdd;
              omemory[todayAdd] = val;
            }
            localSave('memoryObj', omemory, 'object');
            writebox.value = val + '  ' + tip;
            writeboxTips.innerText = tipO['helpMemory'];
          } else if (!regex.test(val)) {
            writeboxTips.innerText = tipO['wrongurl'];
          } else {
            writeboxTips.innerText = '( 请勿重复添加 )';
          }
        }
      }

      menuBtns[10].onclick = function() { // 加日期
        getTime();
        var val = writebox.value;
        let ttday = '';
        if (/[\d]+天后/.test(val) || /明天/.test(val) || /后天/.test(val)) {
          let times = 0;
          if (/明天/.test(val)) {
            times = 1;
          } else if (/后天/.test(val)) {
            times = 2;
          } else {
            times = /([\d]+)天后/.exec(val)[1];
          }
          let d = now + times * 86400000;
          let timer = new Date(d);
          let month = timer.getMonth() + 1;
          let date = timer.getDate();
          ttday = ' ' + timer.getFullYear() + '-' + formatDate(month) + '-' + formatDate(date);
        } else {
          ttday = ' ' + todayAdd;
        }
        writebox.value = val + ttday;
        writeboxTips.innerText = tipO['helpDate'];
      }

      menuBtns[11].onclick = function() { // 加链接
        writeboxTips.innerText = tipO['link'];
        var val = writebox.value;
        var item = false;
        if (/\[([\u4E00-\u9FA5A-Za-z0-9_-\s\|]+)\]\((?:http|https):\/\/[\w\d+&@#\/%?=~_|!:,.;-]+\S/g.test(val)) {
          item = linkSolved(val, 'mdtoLink');
          writebox.value = item;
        } else {
          if (regexDate.test(val)) {
            writebox.value = val.slice(0, -10) + '（<b class="link" onclick = toLink("")></b>）' + val.slice(-10);
          } else {
            writebox.value = val + '（<b class="link" onclick = toLink("")></b>）';
          }
        }

      }
      menuBtns[12].onclick = function() { // 确定任务内容
        var orefreshbtn = toGet('.setrefreshtask');
        var val = writebox.value.trim();
        var txt = orefreshbtn.innerText;
        var temp = '';
        var isOk = true;
        val = val.replace(/\n/g, '');
        val = val.replace(/[\s]*\*[\s]*/g, '*');
        val = val.replace(/javascript/gi, 'javascript');
        if (val && /[$\^&]+/.test(val) || ((txt === '定日期倒计时' || txt === '新增定期任务' || txt === '确定定期任务') && /toLink/
            .test(val))) {
          val = false;
        }
        if (val && !/javascript(?=\:)+/.test(val)) {
          if (txt === '定日期倒计时' || txt === '新增定期任务' || txt === '确定定期任务') {
            if (!/\<[a-z]+\>/.test(val)) {
              if (regexDate.test(val)) {
                let time = regexDate.exec(val);
                if (isDate(time[1], time[2], time[3])) {
                  let date = time[0];
                  let d = new Date(time[1], time[2] - 1, time[3]).getTime();

                  if (d >= now && txt !== '定日期倒计时') { // 已确定是定期任务有意义的日期
                    if (!noticeDateStr) {
                      noticeDateStr = '^' + date;
                    } else if (noticeDateStr.indexOf(date) === -1) {
                      noticeDateStr += '^' + date;
                    }
                    localSave('noticeDates', noticeDateStr);
                  } else if (d < now) { // 不支持过期日期输入
                    writeboxTips.innerText = tipO['warnDay'];
                    isOk = false;
                  }

                  if (txt === '定日期倒计时' && isOk) {
                    countdownFun(val);
                    txtData['countDown'] = val;
                    ocountdowncon.innerText = val;
                    userDefined['countdown'] = val;
                    localSave('userDefined', userDefined, 'object');
                    writeboxTips.innerText = tipO['successCountdown'];
                  } else if (txt === '确定定期任务' && isOk || txt === '新增定期任务' && isOk) {
                    tmpTaskDate = date;
                    var oregular = localGet('regularObj', 'object');
                    regularObj = oregular ? oregular : {};
                    if (txt === '确定定期任务') {
                      let oldDate = tmpNode.parentElement.title;
                      if (date === oldDate) {
                        tmpTaskDate = '原样修改呀';
                        tmpNode = null;
                      } else {
                        taskDelete(null, 'change');
                      }
                    }
                    let dcalendar = calendarData['special'] ? calendarData['special'] : {}; // 日历
                    if (tmpTaskDate === '原样修改呀') { // 不改日期的修改
                      let tmplist = [];
                      tmplist[0] = regularObj[date][0];
                      let item = regularObj[date].slice(1).join('^');
                      item = item.replace(tmpOldtask, val.slice(0, -11)); // 输入框的val去掉日期，不包括11位的空格
                      regularObj[date] = [...tmplist, ...item.split('^')];
                      dcalendar[date] = [...item.split('^')]; // 日历
                      localSave('regularObj', regularObj, 'object');
                      regularDetailFun('newadd');
                      tmpTaskDate = null;

                    } else { // 新增定期任务，确定定期任务-改日期
                      // regularFun(val, date, d);
                      let tmp = val.slice(0, -11).trim(); // 只取内容，去掉空格和日期
                      let isnew = false;
                      if (oregular) {
                        var tmpdatestr = regularObj['datestr'];
                        // log(date, regularObj['datestr']);
                        if (tmpdatestr && tmpdatestr.indexOf(date) !== -1) { // 日期存在里面
                          let oldlist = regularObj[date];
                          oldlist.push(tmp);
                          regularObj[date] = oldlist;
                          regularObj[date][0] = true;
                          dcalendar[date] = oldlist.slice(1); // 日历  -存在旧数据时
                        } else {
                          isnew = true;
                        }
                      } else {
                        regularObj = {};
                        isnew = true;
                      }
                      if (isnew) { // 没有记录的日期
                        if (d < now) {
                          regularObj[date] = [false, tmp];
                        } else {
                          regularObj[date] = [true, tmp];
                        }
                        if (tmpdatestr) {
                          tmpdatestr += '^' + date;
                        } else {
                          tmpdatestr = '^' + date;
                        }
                        dcalendar[date] = [tmp]; // 日历   - 新的数据
                      }

                      regularObj['datestr'] = tmpdatestr;
                      localSave('regularObj', regularObj, 'object');
                      regularDetailFun('newadd');
                      isToNotice();
                    }
                    calendarData['special'] = dcalendar; // 日历
                    localSave('calendar', calendarData, 'object'); // 日历
                    writeboxTips.innerText = tipO['successRegular'];
                  }

                  if (txt === '定日期倒计时' && isOk || txt === '确定定期任务' && isOk) {
                    writebox.value = '';
                    writeLayer();
                  } else if (txt === '新增定期任务' && isOk) {
                    writebox.value = '';
                  }
                } else {
                  writeboxTips.innerText = tipO['warnDate'];
                }
              } else {
                writeboxTips.innerText = tipO['errorDate'];
              }
            } else {
              writeboxTips.innerText = tipO['noLink'];
            }

          } else { //刷新任务部分
            // 预防出错：禁止嵌套输入
            let templist = val.split('*');
            for (let k = 0; k < templist.length; k++) {
              if (/toLink/.test(templist[k])) { // 去链接
                let div = document.createElement('div');
                div.innerHTML = templist[k];
                temp = div.innerText;
              } else {
                temp = templist[k];
              }
              temp = temp.trim().replace(/\n/g, '');
              // temp = temp.trim().replace(/\\/g, '\\');  // 文本中若有\会报错
              // temp = temp.trim().replace(/\//g, '\/');  // 文本中若有\会报错
              // let regex = new RegExp('(' + temp + ')', 'g');
              // debugger
              let firstIndex = val.indexOf(temp);

              if (templist.length > 1 && firstIndex !== -1 && val.substring(firstIndex + 1).indexOf(temp) !== -
                1) {
                writeboxTips.innerText = tipO['warnSame'];
                isOk = false;
                break;
              }
            }
            if (isOk) {
              if (txt === '确定日刷任务*') {
                refreshArr[0] = val;
              } else if (txt === '确定周刷任务*') {
                refreshArr[1] = val;
              } else if (txt === '确定月刷任务*') {
                refreshArr[2] = val;
              }

              localSave('refreshlist', refreshArr, 'object');
              if (odorefreshtask.innerText === '开启任务') {
                writeboxTips.innerText = tipO['successTask'];
              } else {
                writeboxTips.innerText = tipO['successTaskFresh'];
              }

              refreshfun();
              refreshDetailFun();
              changeFinishProgress();
              writebox.value = '';
            }
          }

        } else if (txt === '定日期倒计时' && val === '') { // 倒计时清空
          txtData['countDown'] = '';
          ocountdownTxt.innerText = '';
          ocountdownTxt.classList.remove('show');
          ocountdowncon.innerText = '（暂无）';
          userDefined['countdown'] = '';
          localSave('userDefined', userDefined, 'object');
          writeboxTips.innerText = '( 已删除该倒计时 )';
        } else {
          writeboxTips.innerText = '( 请输入正确内容，注意不包含$^&字符，目前' + txt.slice(2) + '不支持链接输入 )';
        }
      }
      menuBtns[13].onclick = function() { // 开启日刷周刷月刷任务
        // var odorefreshtask = toGet('.dorefreshtask');
        var isok = false;
        var txt = orefreshbtn.innerText;
        var list = refreshArr[3];
        if (txt === '确定日刷任务*' && refreshArr[0]) {
          list[0] = !list[0];
          resetTask('0', list[0]);
          isok = true;
        } else if (txt === '确定周刷任务*' && refreshArr[1]) {
          list[1] = !list[1];
          resetTask('1', list[1]);
          isok = true;
        } else if (txt === '确定月刷任务*' && refreshArr[2]) {
          list[2] = !list[2];
          resetTask('2', list[2]);
          isok = true;
        }
        if (isok) {
          var btntxt = odorefreshtask.innerText;
          if (btntxt === '开启任务') {
            odorefreshtask.innerText = '关闭任务';
          } else {
            odorefreshtask.innerText = '开启任务';
          }
          localSave('refreshlist', refreshArr, 'object');
          refreshfun();
          // log(refreshO);
          refreshDetailFun();
          changeFinishProgress();
          // writeboxTips.innerText = '(操作成功!)';
          orefreshbtn.classList.remove('active');
          odorefreshtask.classList.remove('active');
          writeLayer();

        } else {
          writeboxTips.innerText = tipO['warnTask'];
        }

        function resetTask(key, isnot) {
          if (isnot) {
            refreshO[key] = refreshArr[key * 1];
          } else {
            refreshO[key] = '';
          }
        }
      }



      menuBtns[14].onclick = function() {
        if (numOfSection !== 1) {
          toMainSquare(1);
        }
        var val = writebox.value;
        tosearchtag(val);
        writebox.value = '';
        writeLayer();
      }
      menuBtns[15].onclick = webSearchFun; // 搜索
      menuBtns[16].onclick = function(e) {
        var ele = e.target || e.srcElement;
        var txt = ele.innerText;
        var name = ele.getAttribute('data-name');
        littleset('normal', txt, name);
      }

      function littleset(type = 'normal', txt = 'del', name) {
        var isOk = false;
        if (txt == null || txt.indexOf('确定') === 0) { // 确定做事类型 or 确定可用方法
          let val = writebox.value.trim();
          if (val && type !== 'newset') {
            val = val.replace(/\n/g, '');
            val = val.replace(/[\s]*/g, '');
            val = val.replace(/\*$/g, '');
            if (/^[-_\*\u4E00-\u9FA5A-Za-z0-9]+$/.test(val)) {
              userDefined[name] = val;
              isOk = true;
            } else {
              writeboxTips.innerText = tipO['warnStartTxt'];
            }
          } else if (type !== 'newset') {
            userDefined[name] = growData[name];
            isOk = true;
          }

        } else if (txt.indexOf('确定') === -1) { // 设置搜索范围
          if (osettingbtn.getAttribute('data-val') === '1') {
            settingOpen();
          }

          // 滚动到底部的2个方法：
          // ① div.scrollTop = div.scrollHeight
          // osettingpart.scrollTop = osettingpart.scrollHeight;
          // ② div.scrollIntoView()
          // osettingpart.scrollIntoView(false); // 不能实现，原因？设置面板是一个固定定位？
          // ③ div.scrollTo(x,y), 此处792是osettingpart.scrollHeight
          osettingpart.scrollTo(0, 0);
          osearchModeline.classList.add('active');
        }

        // 保存+关闭框+显示
        if (isOk || type === 'newset') {
          localSave('userDefined', userDefined, 'object');
          writeLayer();

          var temlabel = '';
          var text = '';
          var list = userDefined[name].split('*');
          for (let item = 0; item < list.length; item++) {
            if (name === 'doType') {
              temlabel += '<label><input type="checkbox" name="thingsType" value="' + list[item] +
                '" /><span class="cbox"></span>' + list[item] + '</label>';
            } else if (name === 'betterWay') {
              temlabel += '<label><input type="checkbox" name="vaSkills" value="' + list[item] +
                '" /><span class="cbox"></span>' + list[item] + '</label>';
            }
          }
          if (name === 'doType') {
            odotype.innerText = userDefined[name] || '……默认项……';
            toGet('.taskTypeItems').innerHTML = temlabel;
          } else if (name === 'betterWay') {
            obetterway.innerText = userDefined[name] || '……默认项……';
            toGet('.taskSkillItems').innerHTML = temlabel;
          }
        }
      }

      var otoWebSearchBtn = toGet('.toWebSearchBtn');
      var oworktoWebSearchBtn = toGet('.worktoWebSearchBtn');
      otoWebSearchBtn.onclick = function() {
        if (osettingbtn.getAttribute('data-val') === '1') {
          settingOpen();
        }
        osettingpart.scrollTo(0, 250);
        osearchModeline.classList.add('active');
        toGet('.issearchRecord').classList.add('active');
      }

      function webSearchFun(type) {
        var val = '';
        if (type === 'start') { // 启动页的
          val = taskInput.value.trim();
        } else {
          val = osimpleWriteBox.value.trim() || writebox.value.trim();
          if (type === 'mainpart') {
            val = osimpleWriteBox.value.trim();
          }
          val = val.replace(/javascript/gi, 'javascript');
          if (/toLink+/.test(val) && !(/javascript(?=\:)+/.test(val))) {
            let temp = document.createElement('div');
            temp.innerHTML = val;
            val = temp.innerText;
          }
        }
        if (val) {
          var prelink = growData['searchList'][n_searchChoose];
          var str = '';
          let newval = val.slice(3).trim();
          if (/^a\s/.test(val)) {
            str = 'https://fanyi.baidu.com/?#zh/en/' + val.slice(2);
          } else if (/^b\s/.test(val)) {
            str = 'https://tool.mingdawoo.com/lang/nearby_word/search?q=' + val.slice(2);
          } else if (/^w1\s/.test(val)) {
            str = 'https://zh.wikihow.com/wikiHowTo?search=' + newval;
          } else if (/^w2\s/.test(val)) {
            str = 'https://topbook.cc/search/article?keywords=' + newval;
          } else if (/^g1\s/.test(val)) {
            str = 'https://www.kugou.com/yy/html/search.html#searchType=song&searchKeyWord=' + newval;
          } else if (/^g2\s/.test(val)) {
            str = 'https://music.163.com/#/search/m/?s=' + newval;
          } else if (/^g3\s/.test(val)) {
            str = 'https://so.gushiwen.cn/search.aspx?value=' + newval + '&valuej=' + newval.slice(0, 1);
          } else {
            str = prelink + val;
          }
          toLink(str);
          if (userDefined['recordSearchChose']) {
            let record = '^' + growData['searchNameList'][n_searchChoose] + '： ' + val;
            let oldstr = localGet('searchData', 'string') ? localGet('searchData', 'string') : '';
            recordSearchStr = oldstr + record;
            localSave('searchData', recordSearchStr);
          }
        }
      }
      menuBtns[17].onclick = function() {
        let val = writebox.value;
        let isSame = false;
        if (val.indexOf('[]') === 0) {
          // 进行把单词和含义分开，并将中文含义包裹起来
          val = wordsSolved(val);
        } else if (val.indexOf('-[]') === 0) {
          val = wordsSolved(val, 'reverse');
        } else if (val.indexOf('---') === 0) {
          val = val.slice(3).trim();
          val = val.replace(/(?<=\s)-/g, '*');
          isSame = true;
        } else if (/^(@[\u4e00-\u9fa5a-z-_0-9]+\s)/.test(val)) {
          let item = /^(@[\u4e00-\u9fa5a-z-_0-9]+\s)/.exec(val);
          let sign = item ? item[1] : '';
          val = val.replace(/\*/g, '*' + sign);
          isSame = true;
        } else {
          isSame = true;
        }
        if (val && isSame) {
          val = val.replace(/\*[\s]*\*/g, '*');
          val = val.replace(/\*[\s]*/g, '* ');
          val = val.replace(/\*\n/g, '\n* ');
          val = val.replace(/\n(?!\*)+/g, '\n* ');
          val = val.replace(/(?<!\n)\*+/g, '\n* ');
        }
        writebox.value = val;
        writebox.focus();
      }

      function wordsSolved(str, type = 'normal') {
        let val = str.trim();
        if (type === 'reverse') {
          val = val.slice(3).trim();
          val = val.replace(/(?<=\w)[\s]+/g, '^');
        } else {
          val = val.slice(2).trim();
          val = val.replace(/[\s]+(?=\w)/g, '^');

        }
        let lists = val.split('^');
        for (let i = 0; i < lists.length; i++) {
          let totalitem = /([-a-zA-Z]+)/g.exec(lists[i]);
          let aa = totalitem[0];
          if (aa) {
            lists[i] = lists[i].replace(aa, '[' + aa + ']');
          }
        }
        val = lists.join('  ');
        return val;
      }
      menuBtns[18].onclick = addTextPoint; // @急
      menuBtns[19].onclick = addTextPoint; // @重
      var oaddfunbtns = toGet('.addfunbtns');
      oaddfunbtns.onclick = function(e) {
        addTextPoint(e, 'open');
      };
      menuBtns[20].onclick = function() {
        let val = writebox.value;
        if (/^@[a-z-_\u4e00-\u9fa5]+\s/.test(val)) {
          let pre = val.slice(0, val.indexOf(' '));
          // log(pre);
          inputcollect('writebox', pre);
        } else {
          inputcollect('writebox');
        }
      }

      function addTextPoint(e, type) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        let val = '';
        if (ele.tagName === 'BUTTON') {
          if (type === 'open') {
            val = osimpleWriteBox.value;
            if (ele.innerText === '今') {
              osimpleWriteBox.value = val + ' ' + todayAdd;
            } else if (ele.innerText === '清') {
              inputDeleteFun(osimpleWriteBox);
              // osimpleWriteBox.value = '';
            } else {
              osimpleWriteBox.value = val + ' @' + ele.innerText;
            }
            osimpleWriteBox.focus();
          }
        } else if (ele.tagName === 'SPAN') {
          val = writebox.value.trim();
          let back = '';
          if (regexDate.test(val)) {
            back = val.slice(-10); // 取后面10位 日期
            val = val.slice(0, -10).trim(); // 取前面部分，不包括-10
          }
          writebox.value = val + ' ' + ele.innerText + ' ' + back;
          writebox.focus();
        }
      }
    </script>

    <script>
      // 页面计时代码
      var ocat = toGet('.meetcat');
      var omeetinghouse = toGet('.meetinghouse');
      var otimer = toGet('.timer');
      var oStart = toGet('.startBtn');
      var oflyline = toGet('.flymove');
      var oendtime = toGet('.endtime');
      var obusyouter = toGet('.busyouter');
      var obusyItems = toGet('.busyItems');
      var otip = toGet('.ostartTip');
      oStart.onclick = balloonStart;

      var ostopTimerBtn = toGet('.stopTimerBtn');
      var oballbtnTxt = toGet('.timer-text');
      var otimeStatus = toGet('.timeStatus');
      var iVrunning = null;
      var iVmoveit = null;
      var iVtimeout = null;
      var iVtimeoutnum = null;
      var isTimeCounting = false;
      var recordLeaveNum = 0;


      function recordBusyTime() {
        if (!obusyouter.classList.contains('active')) {
          obusyouter.classList.add('active');
        }
        let val = '<span class="justATime">' + oballbtnTxt.innerText + '</span>';
        recordLeaveNum++;
        obusyItems.innerHTML = obusyItems.innerHTML + val;
        obusyouter.title = '离开的时间记录(已有' + recordLeaveNum + '项)'
      }


      function stopRunning(type = 'stop') {
        clearInterval(iVrunning);
        clearTimeout(iVmoveit);
        clearInterval(iVtimeout);
        clearInterval(iVtimeoutnum);
        if (type === 'clear') { // 清理
          isTimeCounting = true;
          omeetinghouse.classList.remove('active');
          otimer.classList.remove('rest');
          oStart.classList.remove('rest');
          oStart.classList.add('running');
          ocat.classList.add('active');
          otimer.style.animationName = 'resetRun';
          oflyline.style.animationName = 'resetFly';
          obusyouter.classList.remove('over');
          taskFTime.value = '';
          taskFStatus.value = '';
        }
        if (type === 'stop') { // 手动停止 归零
          taskSFTime.setAttribute('data-time', '0');
          isTimeCounting = false;
          simplebtns[2].classList.remove('counting');
          omeetinghouse.classList.remove('active');
          otimer.classList.remove('rest');
          oStart.classList.remove('rest');
          oStart.classList.remove('running');
          ocat.classList.remove('active');
          obusyouter.classList.remove('active');
          obusyItems.innerHTML = '';
          otimer.style.animationName = 'resetRun';
          oflyline.style.animationName = 'resetFly';
          oballbtnTxt.innerHTML = '开始计时';
          otimeStatus.innerText = '';
        }
        if (type === 'over' || type === 'oover') { // 自动停止
          taskSFTime.setAttribute('data-time', '0');
          isTimeCounting = true;
          var lefttime = userDefined['restTime'] || 300;
          var olefttime = toGet('.lefttime');
          olefttime.innerText = '';
          otimer.classList.add('rest');
          oStart.classList.add('rest');
          omeetinghouse.classList.add('active');
          obusyouter.classList.add('over');
          oballbtnTxt.innerHTML = '休息时间';
          otimer.style.animationName = 'timerRun';
          oflyline.style.animationName = 'flyliner';
          if (window.utools && timeCount.totalMin) {
            let tiip = timeCount.totalMin + '分钟计时结束';
            utools.showNotification(tiip);
          }
          // taskPTime.value = timeCount.totalMin;
          iVtimeoutnum = setInterval(function() {
            if (type === 'over') {
              olefttime.innerText = lefttime + '秒';
              otimeStatus.innerText = '[休息] ' + lefttime + ' 秒';
              --lefttime;
            } else {
              lefttime = -1;
            }

            if (lefttime < 0) {
              clearInterval(iVtimeoutnum);
              iVtimeout = setInterval(function() {
                omeetinghouse.classList.remove('active');
                otimer.classList.remove('rest');
                oStart.classList.remove('rest');
                ocat.classList.remove('active');
                obusyouter.className = 'busyouter';
                obusyItems.innerHTML = '';
                otimer.style.animationName = 'resetRun';
                oflyline.style.animationName = 'resetFly';
                oballbtnTxt.innerHTML = '开始计时';
                otimeStatus.innerText = '';
                isTimeCounting = false;
                simplebtns[2].classList.remove('counting');
                clearInterval(iVtimeout);
              }, 1000)

            }
          }, 1000);

        }
        otimer.style.animationPlayState = 'paused';
        oflyline.style.animationPlayState = 'paused';
      }

      function balloonStart(outtime = '') {
        // outtime为已经经过了的时间(毫秒单位)  planTime 、time(秒单位) 
        stopRunning('clear');
        otip.innerText = '(提示：内容先生成后写入)';
        oballbtnTxt.innerHTML = '<span>00</span>:<span>00</span>';
        var time = 0;
        var planTime = 0;
        if (/\d+/.test(outtime)) {
          time = Math.ceil(outtime / 1000);
          planTime = (timeCount.totalMin - time / 60) * 60;
        } else {
          addPresentTime();
          if (taskPTime.value.trim() === '') {
            taskPTime.value = '30';
            planTime = 1800;
          } else {
            planTime = taskPTime.value * 60;
          }
          oendtime.innerText = planTime / 60 + 'min';
          timeCount.totalMin = planTime / 60;
        }
        var oTime = document.querySelectorAll('.startBtn span');
        iVmoveit = setTimeout(function() {
          otimer.style.animationName = 'timerRun';
          otimer.style.animationPlayState = 'running';
          otimer.style.animationTimingFunction = 'steps(' + planTime + ') ';
          otimer.style.animationDuration = planTime + 's ';
          oflyline.style.animationName = 'flyliner';
          oflyline.style.animationPlayState = 'running';
          oflyline.style.animationTimingFunction = 'steps(' + planTime + ') ';
          oflyline.style.animationDuration = planTime + 's ';
        }, 1000)

        iVrunning = setInterval(function() {
          time++;
          var m = Math.floor(time / 60);
          var s = time % 60;
          if (m < 10) {
            m = '0' + m;
          }
          if (s < 10) {
            s = '0' + s;
          }
          oTime[0].innerText = m;
          oTime[1].innerText = s;
          otimeStatus.innerText = '[任务] ' + m + ':' + s;
          if (time > timeCount.totalMin * 60) {
            // 播放音频
            if (userDefined['audioChose'] && !window.utools) {
              var oaudio = document.createElement('audio');
              oaudio.src = './static/叮咚.mp3';
              oaudio.volume = 0.7;
              oaudio.play();
            }
            stopRunning('over');
          }
        }, 1000);
      }

      var timeCount = {
        startMin: 0,
        endMin: 0,
        totalMin: 0
      };
      var keyindex = 0;
      var taskInput = toGet('.taskGoal');
      var taskPTime = toGet('.taskPTime');
      var taskLevel = toGet('.taskLevel');
      var taskSFTime = toGet('.taskSFTime');
      var taskFTime = toGet('.taskFTime');
      var taskFStatus = toGet('.taskFStatus');

      var oupdownbtns = toGet('.updownbtn', true);
      for (let a = 0; a < 4; a++) {
        oupdownbtns[a].onclick = function(e) {
          var temp = a + '';
          autoContent(e, temp);
        }
      }
      toGet('.jumptoProgress').onclick = function() {
        toNewpart(2);
        ocheckbtns[originalClip].classList.remove('active');
        ooneclips[originalClip].classList.remove('active');
        originalClip = 0;
        ocheckbtns[0].classList.add('active');
        ooneclips[0].classList.add('active');

        window.scrollTo(0, ocheckContent.scrollHeight);
      }

      function autoContent(event, mode) {
        // mode有4种情况：0-设置，1-默认，2-上一项， 3-下一项
        if (window.localStorage || window.utools) {
          var assignment = toGet('.taskAGoal');
          var otxt = toGet('.goalTxt');
          if (mode === '0') {
            if (assignment.value) {
              dataObj['defaultTask'] = assignment.value.trim();
              localSave('dataObj', dataObj, 'object');
              otxt.innerText = '(默认项设置成功)';
            } else {
              otxt.innerText = '(请先输入内容)';
            }

          } else if (mode === '1') {
            otxt.innerText = '(恢复出厂默认值)';
            assignment.value = growData['defaultTask'];
          } else if (mode === '3' || mode === '2') {
            const list = localGet('dolist', 'list', null, '*');
            var ohastxt = toGet('.hastText');
            ohastxt.innerText = '';
            // 若有问题看towork的235行
            if (list) {
              if (mode === '2' && keyindex > 0) {
                keyindex--;
                ohastxt.innerText = '第' + (keyindex + 1) + '项';
              } else if (mode === '3' && keyindex < list.length - 1) {
                keyindex++;
                ohastxt.innerText = '第' + (keyindex + 1) + '项';
              } else {
                ohastxt.innerText = '第' + (keyindex + 1) + '项(取值到头了呢)';
              }
              let str = list[keyindex];
              if (/toLink+/.test(str) || /<a[\s]+href/.test(str)) {
                let temp = document.createElement('div');
                temp.innerHTML = str;
                taskInput.value = temp.innerText;
              } else {
                taskInput.value = str;
              }
            } else {
              ohastxt.innerText = '(当前执行清单无事项)';
            }
          }

        } else {
          var e = event || window.event;
          var ele = e.target || e.srcElement;
          ele.classList.add('hidden');
          log('该浏览器版本并不支持localStorage，请更新最新版本或换浏览器。');
        }
      }

      function addTime(time) {
        taskPTime.value = time;
      }

      var opopuptopbtn = toGet('.popuptopbtn');
      opopuptopbtn.onclick = function() {
        if (!oStart.classList.contains('running')) {
          balloonStart();
        }
        var time = 0;
        var txt = taskInput.value.trim();
        if (isTimeCounting) {
          time = '00';
        }
        var str = time + ' | ' + (txt ? txt : '提示文本');
        tellyouTip(
          `【自定义置顶卡片】\n\n${isTimeCounting?'默认将剩余时间作为倒计时钉在桌面(用00标志)，':''}${txt?'选取优先解决内容作为提示。\n':''}\n（tip：卡片可多个，可移动且改变大小）\n（若插件设置里勾选了“隐藏后台时完全退出”，请取消勾选或分离插件Ctrl+D）`,
          'totop', str);
      }

      function makeitTop(val, txt) {
        var tmp = ocountdownTxt ? ocountdownTxt.innerText : '';
        var obj = {};
        var index = growData['tomatoTime'].indexOf('+');
        obj['work'] = growData['tomatoTime'].slice(0, index) * 1;
        obj['rest'] = growData['tomatoTime'].slice(index + 1) * 1;
        var nowdata = {
          time: val,
          countdown: tmp,
          firstdo: txt,
          tomato: obj
        };
        window.showtimer(nowdata);
      }
      // 侦听事件  鼠标滑过，添加class 滑过startouchbtn 点击active

      touchHeart(ostart, 'start');
      var ostarStatus = toGet('.starStatus');

      function touchHeart(parentElement, use) {
        var stars = parentElement.getElementsByClassName('starbtn');
        var starLength = stars.length;

        var txtlist = ['一星', '二星', '三星', '四星', '五星'];

        function toDegree(touchbtn, parentElement) {
          var stars = parentElement.getElementsByClassName('starbtn');
          for (let u = 0; u < starLength; u++) {
            if (touchbtn < u) {
              stars[u].classList.remove('active');
            } else {
              stars[u].classList.add('active');
            }
            if (u < 4) {
              levelboxs[u].classList.remove('active');
            }
          }
        }
        taskLevel.onchange = function() {
          if (taskLevel.value) {
            var degree = taskLevel.value;
            var deg = degree * 1 - 1;
            toDegree(deg, ostart);
          }
        }
        for (let touchbtn = 0; touchbtn < 5; touchbtn++) {
          stars[touchbtn].onmouseenter = function() {
            for (let u = 0; u < 5; u++) {
              if (u <= touchbtn) {
                stars[u].classList.add('startouchbtn');
              }
            }

          }
          stars[touchbtn].onmouseleave = function() {
            for (let u = 0; u < 5; u++) {
              stars[u].classList.remove('startouchbtn');
            }
          }
          stars[touchbtn].onclick = function() {
            if (use === 'start') {
              taskLevel.value = touchbtn + 1;
            } else if (use === 'analyse') {
              ostarStatus.innerText = txtlist[touchbtn];
              n_analyseDiff = touchbtn + 1;
              if (ocheckHeader.classList.contains('smaller')) {
                window.scrollTo(0, 0);
              } else {
                window.scrollTo(0, n_topsize);
              }
              // ocheckContent.scrollIntoView(true);
              showNote(n_analyseDiff);
            }
            toDegree(touchbtn, parentElement);
          }
        }
      }

      function addPresentTime() {
        var date = new Date();
        var nowTime = formatDate(date.getHours()) + ':' + formatDate(date.getMinutes());
        taskSFTime.value = nowTime;
        timeCount.startMin = date.getTime();
        taskSFTime.setAttribute('data-time', timeCount.startMin);
      }

      function getWorkTime(type) {
        var val = 1; // 最终显示值
        var nval = 0; // 时间戳差值
        var date = new Date();
        var begintime = taskSFTime.getAttribute('data-time');
        if (taskSFTime.value.trim()) {
          if (begintime * 1 > 1000) {
            timeCount.endMin = date.getTime();
            if (timeCount.startMin > 0) {
              nval = timeCount.endMin - timeCount.startMin;
              val = Math.ceil(nval / 60000);
            }
          } else {
            // 不是计算出来的起始时间
            var finalTime = date.getHours() * 60 + date.getMinutes();
            var startimeStr = taskSFTime.value.trim();
            var startime = 0;
            // 判断输入时间是否正确
            var hour = /[0-9]+\:/.exec(startimeStr);
            var min = /\:[0-9]+/.exec(startimeStr);
            // log(hour);
            if (hour && hour[0].slice(0, -1) * 1 < 24) {
              startime = (hour[0].slice(0, -1) * 1) * 60;
              // log('hour 成功',startime);
            }
            if (min && min[0].substring(1) * 1 < 60) {
              startime += min[0].substring(1) * 1;
              // log('min 成功',startime);
            }
            if (finalTime >= startime) {
              val = Math.ceil(finalTime - startime);
            } else {
              val = Math.ceil(1440 - finalTime + startime);
            }
            nval = val * 60000;
          }

          if (type === 'try') {
            return nval;
          } else {
            taskFTime.value = val;
            return val;
          }
        }

      }

      function getWorkProccess() {
        var a = taskPTime.value;
        var b = taskFTime.value * 1 > 0 ? taskFTime.value * 1 : getWorkTime();
        if (a * 1 > 0 && b * 1 > 0) {
          var workpercent = Math.round(a / b * 100);
          taskFStatus.value = workpercent + '%';
        }
      }
    </script>

    <script>
      // 每天打卡的实现
      var everyDay = true;
      var dakaData = {}; // 对应 checkDaka 的值，key是内容，value是数组
      var dakaDays = 0; // 总打卡天数
      var daysBtns = toGet('.dataDays', true); // 天数显示元素
      var statusBtn = toGet('.dakastatus'); // 未与已打卡的显示文本


      // 页面打卡区域展示实现
      var odakas = toGet('.odaka', true);
      odakas[0].onclick = toggleDaka;
      odakas[1].onclick = function() {
        toggleDaka('chart', 'dayCheck');
      }
      odakas[2].onclick = toggleDaka;

      function toggleDaka(objnew, objold = null) {
        if (objnew !== 'chart') {
          objnew = 'slideBox';
        }
        var oSliBox1 = toGet(objnew, false, 'classname');
        var nowState = oSliBox1.classList.contains('active');

        if (nowState) {
          oSliBox1.classList.remove('active');
        } else {
          oSliBox1.classList.add('active');
        }

        if (objold === 'dayCheck') {
          var oSliBox2 = toGet('.dayCheck');
          var ulState = oSliBox2.classList.contains('active');
          if (ulState) {
            oSliBox2.classList.remove('active');
          } else {
            oSliBox2.classList.add('active');
          }
        }
        if (objnew === 'chart') {
          paint();
        }
        statusOfDaka();
      }

      function paint() {
        // 绘图 
        var canvas = toGet('#myCanvas');
        var bi = canvas.getContext('2d');
        // 因为出现了模糊,所以把原来html上的canvas的宽高双倍定义了，这里再修改style为单倍
        canvas.style.width = '568px';
        canvas.style.height = '260px';
        bi.lineWidth = 2;
        bi.strokeStyle = 'white';
        bi.clearRect(0, 0, 1136, 520);
        // 坐标轴
        bi.moveTo(92, 28);
        bi.lineTo(100, 20);
        bi.lineTo(108, 28);
        bi.stroke();
        bi.moveTo(100, 20);
        bi.lineTo(100, 428);
        bi.lineTo(1072, 428);
        bi.stroke();
        bi.moveTo(1064, 420);
        bi.lineTo(1072, 428);
        bi.lineTo(1064, 436);
        bi.stroke();
        // bi.fillRect(0,0,568,260);
        bi.fillStyle = '#2a252c';
        bi.fillRect(103, 33, 956, 392);

        if (dakaData) {

          var column = document.querySelectorAll('.chart .col')[0];
          var row = document.querySelectorAll('.chart .row')[0];
          var {
            dakaDaylength,
            maxDays
          } = showDays(); // 打卡最大天数

          var colheight = Math.ceil(340 / maxDays); // 每一格高度：根据最大值和固定高度180px分配坐标点
          var rowwidth = Math.round(852 / dakaDaylength); // 宽度
          var originX = 102;

          bi.font = '18px Arial';
          bi.textAlign = 'center';
          for (let key in dakaData) {
            // 绘图部分 (104,32,956,392);
            bi.fillStyle = '#5eb6ed';
            let y = colheight * dakaData[key][0];
            let x = originX + rowwidth - 10;
            originY = 425 - y;
            bi.fillRect(originX, originY, rowwidth - 10, y);
            bi.fillStyle = '#FFFFFF';

            bi.fillText(key, originX + rowwidth / 2, 472, rowwidth);
            originX += rowwidth;
            // let ospan = document.createElement('span');
            // ospan.innerText = key;
            // ospan.style.width = rowwidth - 5 + 'px';
            // ospan.title = key;
            // row.appendChild(ospan);
          }
          bi.font = '22px Arial';
          for (let i = maxDays; i >= 0; i--) {
            bi.fillStyle = '#FFFFFF';
            bi.fillText(i, 72, 432 - i * colheight, 80);
            // let ospan =  document.createElement('span');
            // ospan.innerText = i;
            // ospan.style.height = colheight + 'px';
            // column.appendChild(ospan);
          }
        }
        bi.fillText('天数', 40, 32);
        bi.fillText('技术', 1080, 480);
      }

      function showDays() {
        var dakaDaylength = 0;
        var maxDays = 0;
        if (!everyDay) {
          statusBtn.innerText = '已';
          statusBtn.classList.add('hascheck');
        }
        for (let key in dakaData) {
          if (dakaData[key][0] > maxDays) {
            maxDays = dakaData[key][0];
          }
          dakaDaylength++;
        }
        return {
          dakaDaylength,
          maxDays
        };
      }


      function statusOfDaka(type) {
        getTime();
        var dakaDaka = localGet('checkDaka', 'object');
        // debugger
        if (dakaDaka) {
          dakaData = dakaDaka;
          var dakadateObj = localGet('dakadateObj', 'object');
          var dakadate = localGet('dakadate', 'object');
          // log(dataObj['lastDaka']);
          if (dataObj['lastDaka'] && dataObj['lastDaka'] != today) {
            everyDay = true; // 未打卡
          } else {
            everyDay = false; // 已打卡
            txtData['todayDaka'] = dakadateObj[today];
            statusBtn.classList.add('hascheck');
            statusBtn.innerText = '已';
          }
          // 把打卡记录遍历出来  dakadate[] 对应 dakadateObj{}
          var odetailDaka = toGet('.detailDaka');
          var liStr = '';
          for (let m = dakadate.length - 1; m >= 0; m--) {
            let tempkey = dakadate[m];
            let tempvalue = dakadateObj[tempkey];
            liStr += '<li>' + tempkey + '&nbsp;&nbsp;&nbsp;&nbsp;' + tempvalue + '</li>';
          }
          odetailDaka.innerHTML = liStr;
        } else {
          // log('第一次初始化，数据还未存入浏览器中。');
          dakaData = {
            "HTML": [0],
            "CSS": [0],
            "JAVASCRIPT": [0],
            "GIT": [0],
            "VUE": [0]
          }
          everyDay = true;
          localDel('dakadate');
          localDel('dakadateObj');
        }
      }

      function everyDayDaka() {
        statusOfDaka();
        // 1.每天只能点击一次 进行数据储存
        // 2.数据显示，存的是对象的字符串
        var oulCheck = toGet('.dakaUl');
        oulCheck.innerHTML = '';
        dakaDays = 0;
        for (let key in dakaData) { // 初始化表
          let oli = document.createElement('li');
          oli.innerHTML = '<span>' + key + '</span><span>' + dakaData[key][0] +
            '</span><b class="btn">打卡</b><i class="btn">删除</i>';
          oulCheck.append(oli);
          dakaDays = dakaDays + (dakaData[key][0] * 1);
        }
        daysBtns[0].innerText = dakaDays;
        daysBtns[1].innerText = dakaDays;
        paint();

        // btnAchieve实现的是打卡和删除按钮的功能
        function btnAchieve() {
          var obDaka = document.querySelectorAll('.dakaUl b');
          var obDel = document.querySelectorAll('.dakaUl i');
          var dakalist = [];
          for (let i = 0; i < obDaka.length; i++) {
            obDaka[i].onclick = function(e) {
              if (everyDay) {
                getTime();
                var keyLi = e.target.parentNode.firstChild.innerText;
                var newNum = 1;
                otodayDakaTxt.innerText = keyLi;
                if (dakaData[keyLi][0]) {
                  newNum = dakaData[keyLi][0] + 1;
                }
                var length = dakaData[keyLi].length;
                dakaData[keyLi][0] = newNum;
                dakaData[keyLi][length] = today;
                txtData['todayDaka'] = keyLi;
                everyDay = false;
                e.target.previousElementSibling.innerText = newNum;
                dakaDays++;
                daysBtns[0].innerText = dakaDays;
                daysBtns[1].innerText = dakaDays;
                localSave('checkDaka', dakaData, 'object');
                dataObj['lastDaka'] = today;
                localSave('dataObj', dataObj, 'object');
                var dakadate = localGet('dakadate', 'object');
                if (dakadate) {
                  dakalist = dakadate;
                  dakalist.push(today);
                } else {
                  dakalist[0] = today;
                }
                localSave('dakadate', dakalist, 'object');
                var dakaobj = {};
                var dakadateobj = localGet('dakadateObj', 'object');
                if (dakadateobj) {
                  dakaobj = dakadateobj;
                }
                dakaobj[today] = keyLi;
                localSave('dakadateObj', dakaobj, 'object');
                paint();
                dakaRefresh();
              }
            };
            obDel[i].onclick = function(e) {
              var keyLi = e.target.parentNode.firstChild.innerText;
              if (txtData['todayDaka'] == keyLi) {
                everyDay = true; // 未打卡
                statusBtn.classList.remove('hascheck');
                statusBtn.innerText = '未';
                dataObj['lastDaka'] = '重置';
                localSave('dataObj', dataObj, 'object');
                otodayDakaTxt.innerText = '未签到';
              }
              e.target.parentNode.remove();
              if (dakaData[keyLi][0]) {
                dakaDays = dakaDays - dakaData[keyLi][0];
              }
              daysBtns[0].innerText = dakaDays;
              daysBtns[1].innerText = dakaDays;
              delete dakaData[keyLi]; // 注意不能用.来获取属性
              localSave('checkDaka', dakaData, 'object');
              dakaFun(dakaData);
              dakaRefresh();
            };
          }
        }

        function dakaRefresh() {
          if (dcalendarType === 'special' && omoreSections[5].classList.contains('active')) {
            chooseCalendarShow(dcalendarType);
          }
        }
        btnAchieve();
        var addBtn = toGet('.addItemBtn');
        addBtn.onclick = function() {
          var oval = toGet('.writeIn');
          var val = oval.value.trim();
          val = val.toUpperCase();
          var valList = [];
          if (val !== '') {
            if (/\*/.test(val)) {
              valList = val.split('*');
              // log(valList);
            } else {
              valList[0] = val;
            }
            // log(dakaData);
            for (var item = 0; item < valList.length; item++) {
              var realval = valList[item].trim();
              if (realval && /^[\u4E00-\u9FA5A-Za-z0-9_-\|]+$/.test(realval)) {
                let oli = document.createElement('li');
                oli.innerHTML = '<span>' + realval +
                  '</span><span>0</span><b class="btn">打卡</b><i class="btn">删除</i>';
                oulCheck.append(oli);
                dakaData[realval] = [];
                dakaData[realval][0] = 0;
              }
            }
            oval.value = '';
            localSave('checkDaka', dakaData, 'object');
            btnAchieve();
          }
        }
      }

      function dakaFun(obj) {
        var date = [];
        var dateObj = {};
        var isok = false;
        if (obj) {
          for (let key in obj) {
            // 获取每个签到项obj[key]的打卡日期数组date,每个日期是val
            if (obj[key][0] > 0) { // 有签到
              let templist = obj[key];
              for (let k = 1; k < templist.length; k++) {
                let val = templist[k];
                date.push(val);
                dateObj[val] = key;
              }
              isok = true;
            }
          }
          if (isok) {
            localSave('dakadate', date, 'object');
            localSave('dakadateObj', dateObj, 'object');
          } else {
            localDel('dakadate');
            localDel('dakadateObj');
          }

        }
      }

      // 启动页内容
      var tempTask = '';



      var oformdelBtn = toGet('.formdelBtn');
      let othingsTypes = toGet('thingsType', true, 'name');
      let ovaSkills = toGet('vaSkills', true, 'name');
      oformdelBtn.onclick = formDateDel;

      function formDateDel() {
        var owrapper = toGet('.maincon-wrapper');
        var inputs = owrapper.getElementsByClassName('oData');

        for (let i = 0; i < inputs.length; i++) {
          inputs[i].value = '';
        }
        for (let j = 0; j < othingsTypes.length; j++) {
          othingsTypes[j].checked = false;
        }
        for (let k = 0; k < ovaSkills.length; k++) {
          ovaSkills[k].checked = false;
        }
        var stars = ostart.getElementsByClassName('starbtn');
        var starLength = stars.length;
        for (let u = 0; u < starLength; u++) {
          stars[u].classList.remove('active');
        }
      }
      var tOstartTip = null;
      var odayTaskbtns = toGet('.dataSTNoteBtn', true);
      odayTaskbtns[0].onclick = generateFormData; //生成表单信息
      odayTaskbtns[1].onclick = function() { // 添加分析数据
        clearTimeout(tOstartTip);
        var oTextAreaS = toGet('.allTaskData');
        var val = oTextAreaS.value;
        val = val.replace(/javascript/gi, 'javascript');
        // debugger
        if (/javascript(?=\:)+/.test(val)) {
          otip.innerText = '(写入失败，禁止javascript:的输入)';
        } else {
          var trueval = todayAdd + val.trim();
          var temp = localGet('analyseData', 'list', null, '^');
          if (temp && temp[0] !== '重置') {
            analyseArr = temp;
            var length = analyseArr.length;
            analyseArr[length] = trueval;
          } else if (temp[0] === '重置' || !temp) {
            analyseArr[0] = trueval;
          }
          localSave('analyseData', analyseArr.join('^'));
          otip.innerText = '(写入成功)';
          showNote(n_analyseDiff);
          if (userDefined['deleteChose'] === 1) {
            formDateDel();
          }
          oTextAreaS.value = '';
          tOstartTip = setTimeout(function() {
            otip.innerText = '(提示：内容先生成后写入)';
          }, 2000);

        }

      };

      // 表单生成数据
      function generateFormData() {
        getTime();
        getWorkProccess();
        var frontTask = '';
        let oTextArea = toGet('.allTaskData');
        let oInputData = toGet('.oData', true);

        var otxt = toGet('.goalTxt');
        var ohastxt = toGet('.hastText');
        otxt.innerText = '';
        ohastxt.innerText = '';
        for (let i = 0; i < othingsTypes.length; i++) {
          if (othingsTypes[i].checked) {
            frontTask = frontTask + othingsTypes[i].value + '\+';
          }
        }
        var length = frontTask.length - 1;
        frontTask = '事件类型与方法：' + frontTask.substring(0, length) + '（方式为';
        for (let i = 0; i < ovaSkills.length; i++) {
          if (ovaSkills[i].checked) {
            frontTask = frontTask + ovaSkills[i].value + '\+';
          }
        }

        let inputDataArr = [];
        for (let i = 0; i < oInputData.length; i++) {
          if (oInputData[i].value) {
            inputDataArr[i] = oInputData[i].value;
          } else {
            inputDataArr[i] = '……';
            if (i === 0) {
              inputDataArr[i] = dataObj['defaultTask'] || growData['defaultTask'];
            }
          }
        }
        let atTime = taskSFTime.value.trim() ? taskSFTime.value.trim().slice(0,2) : new Date().getHours();
        let signItem = '不重要不紧急';
        const osignitem = document.getElementsByName('signType');
        if(inputDataArr[1].indexOf('@重') !== -1 || osignitem[0].checked || osignitem[1].checked){
          signItem = signItem.replace('不重要', '重要');
        }
        if(inputDataArr[1].indexOf('@急') !== -1 || osignitem[0].checked || osignitem[2].checked){
          signItem = signItem.replace('不紧急', '紧急');
        }
        
        length = frontTask.length - 1;
        frontTask = frontTask.substring(0, length) + '）<br />' + 
          (inputDataArr[0] !== '0' ? '\n总任务是：'+inputDataArr[0]+'<br />':'') + 
          '\n优先解决：' + inputDataArr[1] +
          '<br />\n【难度' + inputDataArr[3] + '颗星】 [计划' + inputDataArr[2] + '分钟，实际用时' + inputDataArr[5] +
          '分钟]，完成度：' + inputDataArr[6] +
          '<br />\n困难或障碍出自：' + inputDataArr[7] + ' <br />\n打算：' + inputDataArr[8] +
          '<br />\n【复盘数据】：'+ (atTime>13?(atTime>19?'晚上-':'下午-'):'上午-') + signItem;
        oTextArea.value = frontTask;
        tempTask = frontTask;
        otip.innerText = '(模板数据生成成功，请删除不需要的行，修改每行省略号或冒号后的内容)';

      };
    </script>

    <script>
      var ocheckContent = toGet('.check-content');
      // 检查页逻辑
      var ocheck = oshowings[2];
      var ocheckmenu = toGet('.datamenu');
      var ocheckbtns = ocheckmenu.getElementsByTagName('span');
      var otoTagPartBtns = toGet('.toTagPart', true);
      var ooneclips = toGet('.oneclip', true);
      var originalClip = 0;
      ocheckmenu.onclick = function(e) {
        if (ocheckHeader.classList.contains('smaller')) {
          window.scrollTo(0, 0);
        } else {
          window.scrollTo(0, n_topsize);
        }
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        var index = ele.getAttribute('data-id') * 1;
        if (index !== originalClip) {
          ocheckbtns[index].classList.add('active');
          ooneclips[index].classList.add('active');
          ocheckbtns[originalClip].classList.remove('active');
          ooneclips[originalClip].classList.remove('active');
          originalClip = index;
        }
      }

      var odatatext = toGet('.datatext');
      var odaysClip = toGet('.daysClip');

      function checkSummary(type) {
        var str = '';
        var regex = /^([0-9]{4})\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/;
        var ospans = odatatext.getElementsByTagName('span');
        var dakadate = localGet('dakadate', 'object');
        var dakastr = '';
        var dakadateobj = localGet('dakadateObj', 'object'); // {}日期对应打卡内容
        var finishdate = null;
        if (type !== 'delete') {
          finishdate = localGet('finishdate', 'object');
        } else {
          txtData['finishNum'] = 0; // 任务总数
          finishObj = {};
        }
        var badmoonstr = dataObj['badmoon'];

        if (dakadate) {
          dakastr = dakadate.join('^');
          ospans[0].innerText = dakadate.length;
          ospans[1].innerText = dakadate[0] + '起';
        } else {
          ospans[0].innerText = 0;
          ospans[1].innerText = '今天?';
        }
        if (finishdate) {
          ospans[2].innerText = txtData['finishNum'];
          ospans[3].innerText = finishdate[0] + '起';
        } else {
          ospans[2].innerText = 0;
          ospans[3].innerText = '今天?';
        }

        var diffnum = 0;
        var totalnum = 30;
        var {
          year,
          month,
          date
        } = getTime();
        var tem = {
          '1': 31,
          '2': 28,
          '3': 31,
          '4': 30,
          '5': 31,
          '6': 30,
          '7': 31,
          '8': 31,
          '9': 30,
          '10': 31,
          '11': 30,
          '12': 31
        }
        if (year % 4 === 0 && year % 400 !== 0 || year % 400 === 0) {
          tem['2'] = 29;
        }
        var first = '';
        var firstmonth = '';
        var firstyear = null;
        var firstdatePre = '';
        var firstdate = '';
        var nextdate = '';
        var premonth = 30 - date - 1;
        if (month == 3 && premonth >= 28 && year % 4 == 1) {
          premonth = 27;
          totalnum = 29;
        }
        if (month == 1) {
          firstmonth = '12';
          firstyear = year - 1;
        } else {
          firstmonth = month - 1 + '';
        }
        first = tem[firstmonth] - premonth;
        if (firstyear) {
          firstdatePre = firstyear + '/' + formatDate(firstmonth) + '/';
        } else {
          firstdatePre = year + '/' + formatDate(firstmonth) + '/';
        }
        //  data-num class='gray blue purple|white ||checked'
        // <li data-num="10" class="purple checked"></li>
        for (var i = 0; i <= premonth; i++) {
          firstdate = firstdatePre + formatDate(first + i);
          let num = isInText(firstdate);
          let name = isInClass(firstdate);
          let dakatxt = '';
          let eve = '"';
          if (dakadateobj && dakadateobj[firstdate]) {
            dakatxt = ' ，打卡了' + dakadateobj[firstdate];
          }
          if (num > 0) {
            eve = '" onclick= "searchit(\'' + firstdate + '\')"';
          }
          if (num >= userDefined['tasknum']) {
            str += '<li  title="' + firstdate + ' 完成数:【' + num + '】' + dakatxt + '" class="' + name + eve + '>' +
              num + '</li>';
          } else {
            str += '<li  title="' + firstdate + ' 完成数:【' + num + '】' + dakatxt + '" class="' + name + eve +
              '></li>';
          }
        }
        for (var j = date - 1; j >= 0; j--) {
          nextdate = year + '/' + formatDate(month) + '/' + formatDate(date - j);
          let num = isInText(nextdate);
          let name = isInClass(nextdate);
          let dakatxt = '';
          let eve = '"';
          if (dakadateobj && dakadateobj[nextdate]) {
            dakatxt = ',打卡了' + dakadateobj[nextdate];
          }
          if (num > 0) {
            eve = '" onclick= "searchit(\'' + nextdate + '\')"';
          }
          if (num >= userDefined['tasknum']) {
            str += '<li title="' + nextdate + ' 完成数:【' + num + '】' + dakatxt + '" class="' + name + eve + '>' +
              num + '</li>';
          } else {
            str += '<li title="' + nextdate + ' 完成数:【' + num + '】' + dakatxt + '" class="' + name + eve +
              '></li>';
          }
        }


        odaysClip.innerHTML = str;
        ospans[4].innerText = diffnum + '/' + totalnum;

        function isInClass(day) {
          var str = '';
          var isnot = false;
          if (finishObj[day]) {
            str += 'white ';
            var onepercent = finishObj[day][1].slice(0, -1); // 字符串 '30%'
            if (onepercent * 1 / 100 < userDefined['difficult']) {
              str += 'purple ';
              isnot = true;
            }
            if (badmoonstr && badmoonstr.indexOf(day) !== -1) {
              str += 'blue ';
              isnot = true;
            }
          } else {
            str = '';
          }
          if (dakastr.indexOf(day) !== -1) {
            str += 'checked ';
          }
          if (isnot) {
            diffnum++;
          }
          return str;
        }

        function isInText(day) {
          var num = 0;
          if (finishObj[day]) {
            num = finishObj[day][0];
          }
          return num;
        }
      }

      otoTagPartBtns[0].onclick = function() {
        toMainSquare(1);
        tosearchtag('「分析」');
      }
      otoTagPartBtns[1].onclick = function() {
        toMainSquare(1);
        tosearchtag('[完]');
      }

      // ① 分析层代码
      var oanalyseContent = toGet('.analyseContent');
      var osummaryNum = toGet('.summaryNum');
      var otipclose = toGet('.tipclosebtn');
      var oknowfirst = toGet('.knowfirst');
      otipclose.onclick = function(event) {
        var e = event || window.event;
        var ele = e.target || e.srcElement;
        if (ele.tagName === 'I') {
          var level = ele.getAttribute('data-level');
          cancelStar();
          ele.classList.add('active');
          showNote(level);
        }
        if (ele.tagName === 'SPAN') {
          var val = ele.innerText;
          if (val === '指南') {
            ele.innerText = '关闭';
            oknowfirst.style.display = 'block';
          } else {
            ele.innerText = '指南';
            oknowfirst.style.display = 'none';
          }
        }
      }
      
      const oanalyseTxts = toGet('.totalNumTxt b', true); // 选中类型 总量 总耗时
      const opriorityControl = toGet('.priorityControl'); // 重要选中 紧急选中 
      opriorityControl.onclick = function(event){
      // growData['priority'] '不重要不紧急'
        let e = event || window.event;
        let ele = e.target || e.srcElement;
        if(ele.nodeName === 'SPAN'){
          // 切换状态
          let val = ele.innerText;
          if(ele.classList.contains('active')){
            ele.classList.remove('active');
            growData['priority'] = growData['priority'].replace(val, '不'+val);
          }else{ // 否定变肯定
            ele.classList.add('active');
            growData['priority'] = growData['priority'].indexOf(val) === 1? growData['priority'].slice(1):(growData['priority'].indexOf(val) === 4?growData['priority'].slice(0,3)+val:growData['priority'].slice(0,2)+val);
          }
          showNote(growData['priority']);
        }
      }
      
      function showNote(level, type = 'analyse') { // 难度level为012345；评级level为ABC无
        var outputList_s = ''; // 把添加好html标签的数组元素结合成字符串
        var outputList = []; // 中间值
        var outputListStr = '';
        var day = [];
        var templist = [];
        var fortaglist = [];
        var fortagstr = '';
        var typeis = type;
       
        outputListStr = localGet('analyseData', 'string');
        if (outputListStr) {
          if (outputListStr.substring(0, 2) !== '重置') {
            specifyDo(typeis);
          } else {
            outputListStr = '';
            osummaryNum.innerText = '（0:0-0-0-0）';
          }
        } else {
          outputListStr = growData['defaultAnalyseStr'];
          specifyDo(typeis);
        }

        function specifyDo(type) {
          var abcStatus = false;
          let priorityStatus = false;
          var lengthnum = 1;
          var tempLength = 0;
          var totalA = 0;
          var totalB = 0;
          var totalC = 0;
          let countTime = 0;
          let timeAtA = [0, 0, 0];
          outputList = outputListStr.split('^'); // 若内存有值，则取出转成数组赋值。  
          lengthnum = outputList.length;
          let difflevel = ['', '★', '★★', '★★★', '★★★★', '★★★★★'];
          if (level === 'A' || level === 'B' || level === 'C') {
            abcStatus = true;
            oanalyseTxts[0].innerText = '评级'+level+'里';
          }else if(/[1-5]/.test(level)){
            oanalyseTxts[0].innerText = '难度'+difflevel[level]+'里';
          }else{
            if(level === 0 || level === '无'){
              oanalyseTxts[0].innerText = '全部';
            }else{
              oanalyseTxts[0].innerText = level; // 优先级分类
              priorityStatus = true;
            }
          }
          
          for (let i = 0; i < lengthnum; i++) {
            let val = outputList[i];
            val = val.replace(/javascript/gi, 'javascript');
            if (/javascript(?=\:)+/.test(val)) {
              continue;
            } else {
              // num=2021-02-28, time0 + '/' + time1=16/38,
              let num = val.substring(0, 10).replace('-', '/');
              let dayFormat = formatDay(num); // 把日期转为几天/月/年前
              let olevel = /难度[0-9]+/g.exec(val);
              let otime0 = /\[计划[0-9]+/g.exec(val); // 得到的是一个数组对象 
              let otime1 = /用时[0-9]+/g.exec(val);
              let oprogress = /完成度：[0-9]+/.exec(val);
              let osummary = /【复盘数据】：+(.[^<]*)/g.exec(val);
              let tempdiv = '';
              let templi = '';
              let starNumTxt = 0;
              let htmltxt = '';
              // 区分是难度筛选还是等级筛选

              if (level && level !== '无') { // 要筛选
                if (!abcStatus) { 
                  if(priorityStatus){ // 1.重要紧急筛选
                    if(!osummary || osummary[1].indexOf('-'+level) === -1){
                      continue;
                    }
                  }else if (olevel) { // 2.有难度标记
                    let levelval = olevel[0].substring(2) * 1; // 难度值
                    if (level != levelval) {
                      continue;
                    }
                  } else {
                    continue;
                  }
                } else { // 3.等级筛选
                  if (!oprogress) {
                    continue;
                  }
                }
              }

              if (olevel) {
                starNumTxt = olevel[0].substring(2);
              }
              tempLength++;
              // log(num, otime0, otime1, oprogress);
              if(otime1){
                countTime += otime1[0].substring(2) * 1;
              }
              
              if (otime1 && oprogress) {
                let time0 = otime0[0].substring(3) * 1 || 0;
                let time1 = otime1[0].substring(2) * 1;
                let progress = oprogress[0].substring(4) * 1;
                let leveltxt = 'levelc 找缺点';
                let sign = 'C';
                if (progress >= userDefined['levela']) {
                  leveltxt = 'levela 找优点';
                  sign = 'A';
                  totalA++;
                  timeAtA[0] = timeAtA[0] + time1;
                } else if (progress >= userDefined['levelb']) {
                  leveltxt = 'levelb 找方法';
                  sign = 'B';
                  totalB++;
                  timeAtA[1] = timeAtA[1] + time1;
                } else {
                  totalC++;
                  timeAtA[2] = timeAtA[2] + time1;
                }
                if (abcStatus && sign !== level) {
                  continue;
                }
                
                htmltxt = contentToCss(outputList[i], starNumTxt, sign);
                if (type === 'analyse') {
                  tempdiv = '<div class="' + leveltxt.substring(0, 6) + '" title="' + leveltxt +
                    '"><span class="percent">' + progress +
                    '%</span><span class="timer"><span class="realtime-percent" title="计划用时/实际用时">' + time0 +
                    '/<strong class="realtime">' + time1 +
                    '</strong></span><span class="back" style="width:' + progress + '%;"></span></span>' +
                    htmltxt + '</div>';
                } else if (type === 'tagsolve') {
                  fortagstr = ' ' + difflevel[starNumTxt] + '， ' + otime1 + '分钟 | ' + progress + '%， 评级：' +
                    leveltxt
                    .toUpperCase() + htmltxt;
                  fortaglist.push(fortagstr);
                }

                if (num === day[day.length - 1]) {
                  templi = '<li>' + tempdiv + '</li>';
                } else {
                  day.push(num);
                  templi = '<li><b title="' + num + '">' + dayFormat + '</b>' + tempdiv + '</li>';
                }

              } else {
                
                htmltxt = contentToCss(outputList[i], starNumTxt);
                if (type === 'analyse') {
                  if (num === day[day.length - 1]) {
                    templi = '<li><div>' + htmltxt + '</div></li>';
                  } else {
                    day.push(num);
                    templi = '<li><b title="' + num + '">' + dayFormat + '</b><div>' + htmltxt + '</div></li>';
                  }
                } else if (type === 'tagsolve') {
                  fortagstr = ' ' + difflevel[starNumTxt] + htmltxt;
                  fortaglist.push(fortagstr);
                }
              }
              templist.push(templi);
            }
          }

          function contentToCss(txt, starNumTxt, sign = '') {
            // <span class='starNum'>" + starNumTxt + "</span>
            let starTxt = '';
            let origindate = txt.substring(0, 11);
            let otitle = /事件类型与方法：+(.[^<]*)<br/g.exec(txt);
            let ofirst = /优先解决：+(.[^<]*)/g.exec(txt);
            let ogoal = /总任务是：+(.[^<]*)<br/g.exec(txt);
            let odiffcult = /困难或障碍出自：+(.[^<]*)<br/g.exec(txt);
            let oplan = /打算：+(.[^<]*)/g.exec(txt);
            let osummary = /【复盘数据】：+(.[^<]*)/g.exec(txt);
            let html = '';
            let tipAdd = '';
            let title = otitle && otitle[1] !== '（方式）' ? '<h3 class="titleTxt">' + otitle[1] + '</h3>' : '';
            let way = ofirst ? '<p class="smalltitle">' + ofirst[0] + '</p>' : '';
            let goal = ogoal && ogoal[1] !== '空' ? '<p class="goalTxt">' + ogoal[1] + '</p>' : '';
            let diffcult = odiffcult ? '<p class="diffTxt" title="困难或障碍来自……">' + odiffcult[1] + '</p>' : '';
            let plan = oplan ? '<p class="planTxt" title="打算……">' + oplan[1] + '</p>' : '';
            let ampm = osummary ? ' · ' + osummary[1] : '';
            // log(osummary, ampm)
            if (starNumTxt && starNumTxt * 1 >= 3) {
              tipAdd = '【多练习，多接触】';
            } else if (starNumTxt) {
              tipAdd = '【多角度勤分析，熟练掌握】';
            }

            starTxt = starNumTxt ? '<span class="starNum" title="难度等级：' + starNumTxt + tipAdd + '">' + difflevel[
              starNumTxt] + ampm + '</span>' : '';

            if (type === 'analyse') {
              html = '<div class="conWrapper">' + title + goal + way + diffcult + plan + '</div>' + starTxt;
            } else if (type === 'tagsolve') {
              title = otitle && otitle[1] !== '（方式）' ? ' <u>【' + otitle[1] + '】</u>' : '';
              goal = ogoal && ogoal[1] !== '空' ? ' title="' + origindate + ogoal[1] + '"' : '';
              way = ofirst ? '<p class="smalltitle"' + goal + '>' + ofirst[0] + title + '</p>' : '';
              plan = oplan ? '<p class="nextTxt" title="打算……">' + oplan[1] + '</p>' : '';
              html = way + diffcult + plan;
            }
            return html;


          }
          // 先排序  好难好麻烦-> 在写入的时候就限定是今天的才能写入

          outputList_s = templist.join('');

          // 汇总  总量
          if (!abcStatus) {
            var numleft = tempLength - totalA - totalB - totalC;
            osummaryNum.innerText = '（' + tempLength + ':' + totalA + '-' + totalB + '-' + totalC + '-' +
              numleft + '）';
            oanalyseTxts[1].innerText = tempLength;
            oanalyseTxts[2].innerText = countTime;
          } else {
            osummaryNum.innerText = '（' + tempLength + ': A' + totalA + '- B' + totalB + '- C' + totalC + '）';
            oanalyseTxts[1].innerText = level==='A'? totalA:(level==='B'? totalB:(level==='C'? totalC:tempLength));
            oanalyseTxts[2].innerText = level==='A'? timeAtA[0]:(level==='B'? timeAtA[1]:(level==='C'? timeAtA[2]:countTime));
          }
          
        }


        if (outputList_s.trim() && type === 'analyse') {
          oanalyseContent.innerHTML = outputList_s;
          
        } else if (type === 'analyse') {
          oanalyseContent.innerHTML = '<li><b></b><div>无数据（另：筛选状态下可点击小猫清除状态）</div></li>';
        } else if (type === 'tagsolve') {
          return fortaglist;
        }
      }



      var oanalyseBtn = toGet('.analyseBtn');
      var ocancelbtn = toGet('.cancelbtn');
      var levelboxs = otipclose.getElementsByTagName('i');
      ocancelbtn.onclick = function() {
        cancelStar();
        showNote(0);
      };

      function cancelStar() {
        // ocheckContent.scrollIntoView(true);
        // window.scrollTo(0, n_topsize);
        ostarStatus.innerText = '全部';
        // 把选中的心取消状态
        var stars = oanalyseBtn.getElementsByClassName('starbtn');
        for (let u = 0; u < stars.length; u++) {
          stars[u].classList.remove('active');
          if (u < 4) {
            levelboxs[u].classList.remove('active');
          }
        }
        n_analyseDiff = 0;
      };
      touchHeart(oanalyseBtn, 'analyse'); // 获得点击的难度 n_analyseDiff
      // ② 清单层
      var osearchtxtIn = toGet('.searchtxtIn');
      var osearchbtn = toGet('.searchbtn');
      var oletterbtn = toGet('.letterbtn');
      var odaymenu = toGet('.daymenu');
      var otodoCon = toGet('.todoCon');
      var oweekbtns = toGet('.weekbtn span', true);
      oweekbtns[0].onclick = function() {
        showFinishtask('本周');
      }
      oweekbtns[1].onclick = function() {
        showFinishtask('最近7天');
      }
      oweekbtns[2].onclick = function() {
        showFinishtask('上周');
      }
      var nowshowing = 0;
      var datesortStatus = false;
      oletterbtn.onclick = function() {
        this.classList.toggle('btnon');
        hasSetRegex = !hasSetRegex;
        searchit();
      }
      odaymenu.onclick = function(e) {
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        var obj = ele;
        if (ele.tagName === 'B') {
          obj = ele.parentElement;
        }
        var odaysbtns = odaymenu.getElementsByTagName('span');
        var oworklist = toGet('.worklist', true);
        var top = 0;
        if (obj.tagName === 'SPAN') {
          var index = obj.getAttribute('data-id') * 1;
          odaysbtns[index].classList.add('active');
          if (index != nowshowing) {
            odaysbtns[nowshowing].classList.remove('active');
            nowshowing = index;
            top = oworklist[index].offsetTop;
            // log(index,top,otodoCon.scrollTop)
            otodoCon.scrollTop = top; // 此处的top的值是数值
            // ocheckContent.scrollIntoView(true);
            if (ocheckHeader.classList.contains('smaller')) {
              window.scrollTo(0, 0);
            } else {
              window.scrollTo(0, n_topsize);
            }
          }
        }
      }
      toGet('.toreferpart').onclick = function() { // 总结面板打开《自我检测清单》
        // toNewpart(3); 
        // 关闭该层，打开帮助页
        summPartToggle();
        toNewpart(3, 'mecheck', 7);
      }

      var oTofinishparts = toGet('.tofinishpart', true);
      oTofinishparts[0].onclick = toSeeFinish;
      oTofinishparts[1].onclick = toSeeFinish;

      function toSeeFinish() {
        getTime();
        onowlocation.innerText = '检查页';
        menuBtns[2].setAttribute('data-open', '0');
        menuBtns[2].classList.remove('active');
        floor.style.display = 'none';
        // document.body.style.overflow = 'auto';
        // toNewpart(2);
        // var back = toGet('.bodybg');
        // back.style.display = 'block';
        if (oshowings[2].style.display !== 'block') { // 开启页面
          if (n_newpartshow !== -1) {
            oshowings[n_newpartshow].style.display = 'none';
            simplebtns[n_newpartshow + 1].classList.remove('active');

          }
          oshowings[2].style.display = 'block';
          simplebtns[3].classList.add('active');
          n_newpartshow = 2;
          opages.classList.add('ischeck');
          opages.classList.add('back');
        }
        showFinishtask('reverse');
        checkSummary();
        ocheckbtns[originalClip].classList.remove('active');
        ooneclips[originalClip].classList.remove('active');
        originalClip = 1;
        ocheckbtns[1].classList.add('active');
        ooneclips[1].classList.add('active');
      }

      var hasSetRegex = false; // 决定是否是预设的正则表达式

      var odatesortbtn = toGet('.datesortbtn');
      odatesortbtn.onclick = function() {
        showFinishtask('reverse');
      }

      function showFinishtask(type, search = null) {
        // <span data-id='0'><b>2021/8/8</b> <b>(完成度|任务数)</b></span>
        if (type === 'reverse') {
          search = osearchtxtIn.value;
          datesortStatus = !datesortStatus; // false为顺序-默认
        }
        var weekcolornum = -99;
        getTime();
        var comparedate = '';
        var comparedatelow = '';
        if (type === '本周' || type === '上周') {
          let wkk = [6, 0, 1, 2, 3, 4, 5];
          var weekday = new Date().getDay();
          comparedate = now - 86400000 * wkk[weekday];
          weekcolornum = 0;
          if (type === '上周') {
            comparedatelow = comparedate;
            comparedate = comparedate - 86400000 * 7;
            weekcolornum = 2;
          }
        } else if (type === '最近7天') {
          comparedate = now - 86400000 * 7; // 目标日期大于等于它
          weekcolornum = 1;
        }
        for (let colorit = 0; colorit < 3; colorit++) {
          if (weekcolornum === colorit) {
            oweekbtns[colorit].classList.add('active');
          } else {
            oweekbtns[colorit].className = '';
          }
        }
        var otodoOut = toGet('.todoOut');
        var daylist = localGet('finishdate', 'object');
        var finishlist = localGet('finishlist', 'object'); // 数组，对应总结面板的项
        var countNums = odatesortbtn.children;
        var showingnum = 0; // 当前呈现的项的个数
        var one = ''; //菜单日期每一项
        var day = ''; // 纯日期
        var regex = null;
        var numIndex = 0;
        odaymenu.innerHTML = '';
        otodoOut.innerHTML = '';
        if (daylist && finishlist) {
          countNums[0].innerText = daylist.length;
          odaymenu.classList.remove('hidden');
          txtData['finishNum'] = finishlist.length;
          if (search) {
            try {
              regex = new RegExp(search, 'g');
            } catch (e) {
              console.error('正则输入有问题');
            }
          }
          if (datesortStatus) {
            odatesortbtn.classList.add('reverse');
            for (var i = daylist.length - 1; i >= 0; i--) {
              showingnum += itemSolve(i, numIndex);
              numIndex++;
            }
          } else {
            odatesortbtn.classList.remove('reverse');
            for (var k = 0; k < daylist.length; k++) {
              showingnum += itemSolve(k, k);
            }
          }
          countNums[1].innerText = showingnum;
          if (search || type) {
            // 让内容回到顶部
            otodoCon.scrollTop = 0;
            // ocheckContent.scrollIntoView(true);
            if (ocheckHeader.classList.contains('smaller')) {
              window.scrollTo(0, 0);
            } else {
              window.scrollTo(0, n_topsize);
            }
          }

          function itemSolve(i, spanIndex) {
            // str具体全部任务， searchstr查找后的任务， weekstr为week按钮下的任务
            let searchcount = 0, linum = 0, str = '', searchstr = '', weekstr = '';
            var ul = document.createElement('ul');
            ul.classList.add('worklist');
            day = daylist[i];
            var span = document.createElement('span');
            span.setAttribute('data-id', spanIndex);
            span.setAttribute('data-date', day);

            for (var j = 0; j < txtData['finishNum']; j++) {
              if (finishlist[j].indexOf(day) !== -1) {
                linum++;
                let temp = finishlist[j].substring(10);
                let newtemplist = temp.match(/([A-Za-z]+)/g);
                // log(newtemplist);
                if (hasSetRegex && newtemplist) {
                  let ttstr = '';
                  let endidx = 0;
                  for (let k = 0; k < newtemplist.length; k++) {
                    let element = '<span class="letter">' + newtemplist[k] + '</span>';
                    let iidx = temp.indexOf(newtemplist[k], endidx);
                    ttstr = ttstr + temp.slice(endidx, iidx) + element;
                    endidx = iidx + newtemplist[k].length;
                    // log(ttstr, endidx);
                  }
                  temp = ttstr;
                }
                if (regex && finishlist[j].indexOf(search) !== -1) {
                  let newspan = '';
                  newspan = '<span class="chosed">' + search + '</span>';
                  let tempval = temp.replace(regex, newspan);

                  searchstr += '<li title = "' + day + '">' + tempval + '</li>';
                  searchcount++;
                } else if (comparedate !== '') {
                  let time = regexOnlyDate.exec(day);
                  let dd = new Date(time[1], time[2] - 1, time[3]).getTime();
                  if (dd >= comparedate) {
                    if ((comparedatelow !== '' && dd < comparedatelow) || comparedatelow === '') {
                      weekstr += '<li title = "' + day + '">' + temp + '</li>';
                      searchcount++;
                    }
                  }
                } else {
                  // log(j,finishlist[j],str);
                  str += '<li title = "' + day + '">' + temp + '</li>';
                }
              }
            }

            if (search) {
              str = searchstr;
            } else if (comparedate !== '') {
              str = weekstr;
            } else {
              searchcount = linum;
            }

            if (searchcount || userDefined['unshowNoneChose']) {
              str = '<li class="daycount">' + day + '&nbsp;（' + searchcount + '）</li>' + str;
            } else {
              span.classList.add('hide');
              ul.classList.add('hide');
            }

            ul.innerHTML = str;
            // log(finishObj, day)
            one = '<b>' + day + '</b> <b>(' + linum + ' | ' + finishObj[day][1] + ')</b>'
            span.innerHTML = one;
            odaymenu.appendChild(span);
            otodoOut.appendChild(ul);


            // finishObj[day] = [finishpercent[day], linum];

            return searchcount;
          }
        } else {
          odaymenu.classList.add('hidden');
          countNums[0].innerText = '0';
          countNums[1].innerText = '0';
        }
      }
      osearchbtn.onclick = searchit;

      function searchit(date = null) {
        var val = typeof date === 'string' ? date : osearchtxtIn.value.trim();
        val = val.replace(/javascript/gi, 'javascript');
        if (val && /javascript(?=\:)+/.test(val) || val && /\<[a-z]+\>.*\<\/[a-z]+\>/.test(val)) {
          osearchtxtIn.value = '（不可搜索）' + val;
        } else if (regexOnlyDate.test(val)) {
          var oworklist = toGet('.worklist', true);
          let spans = odaymenu.querySelectorAll('span');
          var index = 0;
          for (let a = 0; a < spans.length; a++) {
            if (val == spans[a].getAttribute('data-date')) {
              index = a;
              spans[a].className = 'active';
              nowshowing = a;
            } else {
              spans[a].className = '';
            }
          }

          // log(index,oworklist[index]);
          let top = oworklist[index].offsetTop;
          otodoCon.scrollTop = top; // 此处的top的值是数值
          if (!date) {
            // ocheckContent.scrollIntoView(true);
            if (ocheckHeader.classList.contains('smaller')) {
              window.scrollTo(0, 0);
            } else {
              window.scrollTo(0, n_topsize);
            }
          } else {
            if (originalClip !== 1) {
              ocheckbtns[1].classList.add('active');
              ooneclips[1].classList.add('active');
              ocheckbtns[originalClip].classList.remove('active');
              ooneclips[originalClip].classList.remove('active');
              originalClip = 1;
            }
          }
        } else {
          showFinishtask('watch', val);
        }
      }

      osearchtxtIn.onkeydown = function(e) {
        var event = e || window.event;
        if (event.keyCode == 13) {
          searchit();
        }
      }

      // ③ 记忆层
      var omemoryCons = toGet('.memoryCon', true);

      function loadMemory() {
        getTime();
        let memoryObj = localGet('memoryObj', 'object');
        var omemoryArea = toGet('.memoryArea');
        var omemoryclearbtn = toGet('.memoryclearbtn');
        var ovisibleBtn = toGet('.contentHiddenBtn');
        var lastDate = '';
        var expirestr = ''; // 逾期的内容
        if (memoryObj) {
          omemory = memoryObj;
          // 取完数据了，接下来是按照遗忘记忆表的日期计算着来显示（只管天数）
          // 5分钟 30分钟 12小时  1天   2天    4天    7天   15天
          let [undefined, year, month, date] = /(\d{4})-(\d{2})-(\d{2})/.exec(todayAdd);
          let newDay = '';
          let num = {
            "15": [16, 13, 16, 15, 16, 15, 16, 16, 15, 16, 15, 16],
            "7": [24, 21, 24, 23, 24, 23, 24, 24, 23, 24, 23, 24],
            "4": [27, 24, 27, 26, 27, 26, 27, 27, 26, 27, 26, 27],
            "2": [29, 26, 29, 28, 29, 28, 29, 29, 28, 29, 28, 29],
            "1": [30, 27, 30, 29, 30, 29, 30, 30, 29, 30, 29, 30]
          }
          let daymemorylist = [1, 2, 4, 7, 15];
          memorylist = [];

          function isWrite(n, index) {
            // 从今天起，算前1,2,4,7,15天的日期，找对应的内容
            let numlist = num[n];
            let tempstr = ''; // 记忆项内容
            let templist = [];
            // debugger;
            if (date > n) {
              let newdate = date - n;
              if (newdate < 10) {
                newdate = '0' + newdate;
              }
              newDay = year + '-' + month + '-' + newdate;
            } else if (month > 1) {
              let newmonth = month - 1;
              let newdate = date * 1 + numlist[newmonth - 1];
              if (newmonth < 10) {
                newmonth = '0' + newmonth;
              }
              newDay = year + '-' + newmonth + '-' + newdate;
            } else { // 当日份不够减，月份是1月的时候，处理年份
              let newyear = year - 1;
              let newdate = date * 1 + numlist[11];
              newDay = newyear + '-' + 12 + '-' + newdate;
            }
            lastDate = newDay;
            if (omemory[newDay]) {
              memorylist.push(newDay + ' |  ' + omemory[newDay]);
              templist = omemory[newDay].split('~');
              for (let i = 0; i < templist.length; i++) {
                let ttemp = templist[i];
                ttemp = itemToVisible(ttemp);
                tempstr += '<li>' + ttemp + '</li>'
              }
            }
            omemoryCons[index].title = newDay;
            omemoryCons[index].innerHTML = tempstr;
          }

          for (let i = 0; i < 5; i++) {
            isWrite(daymemorylist[i], i);
          }
          // 逾期处理
          var time = /(\d{4})-(\d{2})-(\d{2})/.exec(lastDate);
          var d = Date.UTC(time[1], time[2] - 1, time[3]);
          for (let key in omemory) {
            if (key !== 'origin') {
              let timer = /(\d{4})-(\d{2})-(\d{2})/.exec(key);
              let t = Date.UTC(timer[1], timer[2] - 1, timer[3]);
              let expiretemp = [];
              if (t < d) {
                expirelist.push(key);
                expiretemp = omemory[key].split('~');
                for (let k = 0; k < expiretemp.length; k++) {
                  expirestr += '<li>' + expiretemp[k] + '</li>'
                }
              }
            }
          }
          if (expirestr) {
            omemoryCons[5].innerHTML = expirestr;
          } else {
            omemoryCons[5].innerHTML = '<li class="justtip">（没有过期的记忆数据哦）</li>';
          }
        } else {
          for (let k = 0; k < 6; k++) {
            omemoryCons[k].innerHTML = '<li class="justtip">(空)</li>';
          }
        }

        function itemToVisible(item) {
          let newtemplist = item.match(/\[(.+?)\]/g);
          let finalitem = item;
          if (newtemplist) {
            for (let k = 0; k < newtemplist.length; k++) {
              let span = '<span class="itemhide">' + newtemplist[k] + '</span>';
              finalitem = finalitem.replace(newtemplist[k], span);
            }
          }
          return finalitem;
        }
        ovisibleBtn.onclick = function() {
          let ospan = ovisibleBtn.querySelector('span');
          if (ospan.innerText === '开启主动回忆模式') {
            omemoryArea.classList.add('visible');
            ospan.innerText = '关闭主动回忆模式';
            // ocheckContent.scrollIntoView(true);
            if (ocheckHeader.classList.contains('smaller')) {
              window.scrollTo(0, 0);
            } else {
              window.scrollTo(0, n_topsize);
            }
          } else {
            omemoryArea.classList.remove('visible');
            ospan.innerText = '开启主动回忆模式';
          }
        }
        otoTagPartBtns[2].onclick = function() {
          toMainSquare(1);
          tosearchtag('#记忆');
        }
        omemoryclearbtn.onclick = function() {
          tellyouTip(tellO['delTimeOutItem'], 'sure', '清空逾期项');
        }
      }
      var otoMemorypart = toGet('.toMemorypart');
      otoMemorypart.onclick = function() {
        getTime();
        // var back = toGet('.back');
        // back.style.display = 'block';
        omain.classList.add('unshow');
        opages.classList.add('ischeck');
        opages.classList.add('back');
        onowlocation.innerText = '检查页';
        oshowings[2].style.display = 'block';
        simplebtns[3].classList.add('active');
        n_newpartshow = 2;
        checkSummary();
        if (ocheckHeader.classList.contains('smaller')) {
          window.scrollTo(0, 0);
        } else {
          window.scrollTo(0, n_topsize);
        }
        ocheckbtns[originalClip].classList.remove('active');
        ooneclips[originalClip].classList.remove('active');
        ocheckbtns[2].classList.add('active');
        ooneclips[2].classList.add('active');
        originalClip = 2;
      }
    </script>

    <script>
      // 帮助页 book

      var obookmenu = toGet('.bookmenu');
      var obookOuter = toGet('.book-outer');
      var obookCon = toGet('.bookCon');
      var txtparts = obookCon.getElementsByClassName('txtpart');
      var txtpartshow = 0;
      var ofirstCon = toGet('.firstCon');
      var oResults = toGet('.result', true);
      var orefreshbtn = toGet('.setrefreshtask');
      var odorefreshtask = toGet('.dorefreshtask');
      var odataclears = toGet('.dataclear', true);
      var othemechooses = toGet('.themechoose', true);
      var osearchModes = toGet('.searchMode', true);

      var osetCountdownbtn = toGet('.setCountdownbtn');
      osetCountdownbtn.onclick = function() {
        writeLayer('日期倒计时');
        writebox.value = txtData['countDown'];
        orefreshbtn.innerText = '定日期倒计时';
        writeboxTips.innerText = tipO['addCountdown'];
      }
      var osetTaskbtns = toGet('.setTaskbtn', true);
      osetTaskbtns[0].onclick = function() {
        writeLayer('刷新任务');
        refreshfun(4); // 等同于 this.getAttribute('data-index') * 1;
        orefreshbtn.innerText = '确定日刷任务*';
      }
      osetTaskbtns[1].onclick = function() {
        writeLayer('刷新任务');
        refreshfun(5);
        orefreshbtn.innerText = '确定周刷任务*';
      }
      osetTaskbtns[2].onclick = function() {
        writeLayer('刷新任务');
        refreshfun(6);
        orefreshbtn.innerText = '确定月刷任务*';
      }

      function loadBook() {
        obookmenu.onclick = function(e) {
          var olis = obookmenu.getElementsByTagName('li');
          var event = e || window.event;
          var ele = event.target || event.srcElement;
          var index = ele.getAttribute('data-id') * 1;
          // log(index, ele, txtparts, txtpartshow);
          if (index !== -1 && index !== txtpartshow) {
            olis[index].classList.add('active');
            txtparts[index].classList.add('active');
            olis[txtpartshow].classList.remove('active');
            txtparts[txtpartshow].classList.remove('active');
            txtpartshow = index;
            if (isOpenSetting) {
              oshowings[n_newpartshow].style.top = '52px';
              osettingbtn.setAttribute('data-change', '1');
            }
            window.scrollTo(0, 0);
          }
        }
      }

      var ojumptoknew = toGet('.jumptoknew');
      ojumptoknew.onclick = function() {
        var olis = obookmenu.getElementsByTagName('li');
        olis[txtpartshow].classList.remove('active');
        txtparts[txtpartshow].classList.remove('active');
        olis[2].classList.add('active');
        txtparts[2].classList.add('active');
        txtpartshow = 2;
        window.scrollTo(0, 0);
      }
      // 主题选择
      var othemeline = toGet('.themeline');
      othemeline.onclick = function() {
        chooseTheme(-1);
      };


      // 逻辑实现
      ofirstCon.onclick = function(e) {
        var event = e || window.event;
        var span = event.target || event.srcElement;
        if (span.tagName === 'SPAN') {
          var isSucess = false;
          var index = event.target.getAttribute('data-btn') * 1;
          var inputs = ofirstCon.getElementsByTagName('input');
          var val = 0;
          var resultChoose = Math.floor(index / 2) + 3;
          if (index <= 3) {
            val = inputs[index + 1].value * 1;
            if (val && val >= 1 && val <= 100) {
              val = Math.round(val);
              let valA = userDefined['levela'];
              let valB = userDefined['levelb'];
              if (index === 2 && val < valB) { // A改-判断B无效情况
                let old = inputs[5].getAttribute('placeholder') + '(失效)';
                inputs[5].setAttribute('placeholder', old);
              }
              if (index <= 2 || index === 3 && val < valA) { // B改-需小于A
                isSucess = true;
              }
              inputs[index + 1].value = '';
            } else {
              val = 0;
            }
            if (index === 0 && val) {
              userDefined['tasknum'] = val;
            } else if (index === 1 && val) {
              userDefined['difficult'] = val / 100;
            } else if (index === 2 && val) {
              userDefined['levela'] = val;
            } else if (index === 3 && val) {
              userDefined['levelb'] = val;
            }
          } else if (index >= 4 && index < 7) {
            // debugger
            writeLayer('刷新任务');
            refreshfun(index);
            if (index === 4) {
              orefreshbtn.innerText = '确定日刷任务*';
            } else if (index === 5) {
              orefreshbtn.innerText = '确定周刷任务*';
            } else if (index === 6) {
              orefreshbtn.innerText = '确定月刷任务*';
            }
          } else if (index === 7) {
            resultChoose = 2;
            val = inputs[1].value * 1;
            if (val && val >= 1) {
              isSucess = true;
              val = Math.round(val);
              inputs[1].value = '';
              userDefined['restTime'] = val;
            }
          } else if (index === 8) { // 做事类型自定义
            setText('做事类型', 'doType');
          } else if (index === 9) { // 可用方法自定义
            setText('可用方法', 'betterWay');
          } else if (index === 10) {
            writeLayer('定期任务');
            orefreshbtn.innerText = '新增定期任务';
            writeboxTips.innerText = tipO['addRegular'];
          } else if (index === 11) {
            resultChoose = 5;
            val = inputs[6].value * 1;
            if (val >= 0) {
              isSucess = true;
              val = Math.round(val);
              inputs[6].value = '';
              userDefined['taskMentionTime'] = val;
              otaskMentionNum.innerText = val;
              isToNotice('get');
            }
          } else if (index === 12) { // 链接互用
            settingOpen();
            toMainSquare(2);
            linknectShowFun();
          } else if (index === 13) { // 日期倒计时
            writeLayer('日期倒计时');
            writebox.value = txtData['countDown'];
            orefreshbtn.innerText = '定日期倒计时';
            writeboxTips.innerText = tipO['addCountdown'];
          } else if (index === 14) { // 番茄时间
            val = inputs[0].value.trim(); // 预期得到‘25+5’格式
            if (/^[\d\.]+\+[\d\.]+$/.test(val)) { // 格式对
              let [, work, rest] = /^([\d\.]+)\+([\d\.]+)$/.exec(val);
              // log(work, rest);
              if (!isNaN(work) && !isNaN(rest)) { // 数值对 => 存值和显示
                isSucess = true;
                resultChoose = 1;
                growData['tomatoTime'] = val;
                userDefined['tomato'] = val;
                inputs[0].value = '';
              }
            }
          }

          function setText(str, name) {
            menuBtns[16].classList.remove('set');
            menuBtns[16].innerText = '确定' + str + '*';
            menuBtns[16].classList.add('active');
            menuBtns[16].title = '启动页的' + str + '，设置为空时恢复默认值';
            menuBtns[16].setAttribute('data-name', name);
            writebox.value = userDefined[name] || growData[name];
            menuBtns[5].innerText = '加入随记';
            writeLayer('启动页自定义');
            writeboxTips.innerText = '( 正在修改启动页 ' + str + ' 的选项…… )';
          }


          if (isSucess) {
            oResults[resultChoose].innerText = '(成功)';
            localSave('userDefined', userDefined, 'object');
            if (index === 7) {
              userdefinedfun();
            } else {
              userdefinedfun('setting');
            }
            if (index === 2 || index === 3) {
              showNote(n_analyseDiff);
            }
            if (index === 0 || index === 1) {
              checkSummary();
            }
          } else {
            if (index <= 3 || index === 7 || index === 11) {
              oResults[resultChoose].innerText = '(失败)';
            }
          }

        }
      }
      var otaskaddbtn = toGet('.taskaddbtn');
      otaskaddbtn.onclick = function() {
        writeLayer('定期任务');
        orefreshbtn.innerText = '新增定期任务';
        writeboxTips.innerText = tipO['addRegular'];
      }
      odataclears[19].onclick = function() {
        tellyouTip(tellO['delSetting'], 'sure', '清空所选项');
      }

      var odelbtns = toGet('.delbtn', true);
      var otoDeletedatas = toGet('.toDeletedata', true);
      odelbtns[0].onclick = function() {
        tellyouTip(tellO['delProgress'], 'sureDel', '1');
      };
      odelbtns[1].onclick = function() {
        tellyouTip(tellO['delFinish'], 'sureDel', '2');
      };
      odelbtns[2].onclick = function() {
        tellyouTip(tellO['delMemory'], 'sureDel', '3');
      };
      otoDeletedatas[0].onclick = function() {
        tellyouTip(tellO['delSomelist'], 'sureDel', '4');
      };
      otoDeletedatas[1].onclick = function() {
        tellyouTip(tellO['delFinish'], 'sureDel', '2');
      };

      function allDelFun(index = 'none') {
        var isDel = false;
        var isCheck = false;
        // 打卡数据 lastDaka checkDaka{} dakadate[] dakadateObj{}
        if (odataclears[0].checked || index === '0') {
          var oulCheck = toGet('.dakaUl');
          dakaData = {};
          dakaDays = '';
          localSave('checkDaka', dakaData, 'object');
          dataObj['lastDaka'] = '重置';
          localSave('dataObj', dataObj, 'object');
          localDel('dakadate');
          localDel('dakadateObj');
          everyDay = true;
          statusBtn.classList.remove('hascheck');
          statusBtn.innerText = '未';
          daysBtns[0].innerText = 0;
          daysBtns[1].innerText = 0;
          oulCheck.innerHTML = '';
          paint();
          odataclears[0].checked = false;
          isDel = true;
          isCheck = true;
        }
        // 进程分析数据
        if (odataclears[1].checked || index === '1') {
          localSave('analyseData', '重置');
          analyseArr = [];
          n_analyseDiff = 0;
          showNote(0);
          cancelStar();
          odataclears[1].checked = false;
          isDel = true;
        }
        // 完成任务 finishlist[] finishdate[]  finishObj 日期:[完成量，完成率]
        if (odataclears[2].checked || index === '2') {
          let lastDelFinishDate = localGet('lastDelFinishDate', 'object') ? localGet('lastDelFinishDate',
            'object') : [];
          var oldfinishItem = localGet('oldfinishItem', 'object') ? localGet('oldfinishItem', 'object') : [];
          let nowobj = {};
          let reg = /^@([\u4e00-\u9fa5a-z-_0-9]+)\s/;
          for (let dd = 0; dd < finishList.length; dd++) {
            let value = finishList[dd].slice(15);
            if (reg.test(value)) {
              let sign = reg.exec(value)[1];
              let tmp = nowobj[sign] ? nowobj[sign] : [];
              tmp[tmp.length] = today + ' ' + value.slice(sign.length + 1);
              nowobj[sign] = tmp;
            }
          }
          oldfinishItem[oldfinishItem.length] = nowobj;
          lastDelFinishDate[lastDelFinishDate.length] = today;
          localSave('oldfinishItem', oldfinishItem, 'object');
          localSave('lastDelFinishDate', lastDelFinishDate, 'object');

          txtData['finishNum'] = 0; // 任务总数
          for(let key in finishObj){ // 任务对象，日期-[总数，完成率] == 最近36天内的不删
            if(countBetweenDay(todayAdd, key.replace(/\//g, '-'), 'betweenNum') > 36){
              delete finishObj[key];
            }
          }
          
          localSave('finishObj', finishObj, 'object');
          finishList = [];
          localDel('finishlist');
          localDel('finishdate');
          datasimpleshow(finishList, places[1], 'simple');
          datasimpleshow(finishList, uls[4], 'simple');
          odataclears[2].checked = false;
          showFinishtask();
          checkSummary('delete');
          isDel = true;
        }
        // 记忆卡数据清除
        if (odataclears[3].checked || index === '3') {
          localDel('memoryObj');
          odataclears[3].checked = false;
          loadMemory();
          memorylist = [];
          omemory = {};
          uls[0].style.display = 'none';
          otoMemorypart.classList.remove('active');
          isDel = true;
        }
        // 清单数据清除
        if (odataclears[4].checked || index === '4') {
          for (let m = 0; m < 7; m++) {
            if (m >= 3 && m <= 5) {
              continue;
            }
            let name = datalist[m];
            beforeData[name] = [];
          }
          uls[1].innerHTML = '';
          uls[2].innerHTML = '';
          uls[3].innerHTML = '';
          dolist.innerHTML = '';
          daylist.innerHTML = '';
          waitlist.innerHTML = '';
          recycle.innerHTML = '';
          thingsNums[0].innerText = 0;
          thingsNums[1].innerText = 0;
          thingsNums[2].innerText = 0;
          saveData();
          localSave('dolist', '');
          changeFinishProgress(0, 0);
          odataclears[4].checked = false;
          isDel = true;
        }

        // 检查卡
        if (odataclears[5].checked) {
          beforeData['checkList'] = [];
          places[0].innerHTML = '';
          localDel('checklist');
          odataclears[5].checked = false;
          isDel = true;
        }
        // 小本本
        if (odataclears[6].checked) {
          beforeData['summaryList'] = [];
          places[2].innerHTML = '';
          localDel('summarylist');
          odataclears[6].checked = false;
          isDel = true;
        }
        // 刷新任务
        if (odataclears[7].checked) {
          delRefreshArr = [];
          refreshO = {};
          tmpRefreshA = [];
          localDel('delRefresh');
          localDel('refreshlist');
          refresh.innerHTML = '';
          var obtns = document.querySelectorAll('.firstCon .refreshbtn');
          var statetxts = document.querySelectorAll('.refreshpart i');
          var refreshUls = document.querySelectorAll('.refreshUl');
          for (let irr = 0; irr < 3; irr++) {
            obtns[irr].innerText = obtns[irr].getAttribute('data-txt');
            statetxts[irr].innerText = ' (未开启)';
            refreshUls[irr].innerHTML = '';
          }
          changeFinishProgress();
          odataclears[7].checked = false;
          isDel = true;
        }
        // 删除所有刷新任务的完成记录
        if (odataclears[8].checked) {
          delRefreshArr = [];
          localDel('delRefresh');
          refreshfun();
          refreshDetailFun();
          changeFinishProgress();
          odataclears[8].checked = false;
          isDel = true;
        }

        // 定期任务
        if (odataclears[9].checked) {
          regularObj = {};
          noticeDateStr = '';
          localDel('regularObj');
          localDel('noticeDates');
          txtData['regularNum'] = 0;
          oregularUl.innerHTML = '';
          oregularUlPass.innerHTML = '';
          opassline.className = 'passline hidden';
          otaskwarn.className = 'taskwarn';
          odataclears[9].checked = false;
          isDel = true;
        }
        // 参考资料
        if (odataclears[10].checked) {
          beforeData['tmpReference'] = [];
          reference.innerHTML = '';
          saveData();
          odataclears[10].checked = false;
          isDel = true;
        }
        // 收集箱
        if (odataclears[11].checked) {
          datacollectbox = [];
          ocollectUl.innerHTML = '';
          ocollectPnums[0].innerHTML = 0;
          ocollectPnums[1].innerHTML = 0;
          tempcheckcountnum = 0;
          localSave('collect', datacollectbox, 'object');
          odataclears[11].checked = false;
          isDel = true;
        }
        // 回收箱
        if (odataclears[12].checked) {
          beforeData['tmpRecycle'] = [];
          recycle.innerHTML = '';
          saveData();
          odataclears[12].checked = false;
          isDel = true;
        }
        // 全部
        if (odataclears[13].checked) {
          localStorage.clear();
          if (window.utools) {
            isUtoolsOut = true;
            utools.outPlugin();
          } else {
            window.location.reload();
          }
        }
        // 自定义数据清除
        if (odataclears[14].checked) {
          let ouserDefined = {
            'levela': 80,
            'levelb': 65,
            'tasknum': 10,
            'difficult': 0.3,
            'themeMode': 0,
            'searchWeb': 0,
            'deleteChose': 0,
            'audioChose': 0,
            'unshowNoneChose': 0,
            'recordSearchChose': 0,
            'calendarSortChose': 0,
            'controlChose': 0,
            'saveLocalChose': 1,
            'outputChose': 'all',
            'restTime': 300,
            'doType': '整理*社交*生活*尝试*学习*项目*教学*反三',
            'betterWay': '实践试错*提问搜索*视频-模块化*实战模仿*导图-联想分类*讨论*故事',
            'taskMentionTime': 3,
            'tolinkrefer': 0
          };
          localSave('userDefined', ouserDefined, 'object');
          odataclears[14].checked = false;
          // debugger
          userdefinedfun();
          isDel = true;
          isCheck = true;
        }
        // 搜索记录
        if (odataclears[15].checked) {
          localDel('searchData');
          recordSearchStr = '';
          odataclears[15].checked = false;
          isDel = true;
        }
        // 项目失效数据
        if (odataclears[16].checked) {
          existItemArr = localGet('existItem', 'object') ? localGet('existItem', 'object') : ['模板'];
          for (let itemid in itemObj) {

            if (existItemArr.indexOf(itemid) === -1) {
              delete itemObj[itemid];
            }
          }
          localSave('itemObj', itemObj, 'object');
          odataclears[16].checked = false;
          isDel = true;
        }
        // 所有项目数据
        if (odataclears[17].checked) {
          delete dataObj['filedlist'];
          localSave('dataObj', dataObj, 'object');
          localDel('lastDelFinishDate');
          localDel('oldfinishItem');
          localDel('itemObj');
          filedArr = [];
          lastDelFinishDate = [];
          oldfinishItem = [];
          itemObj = {};
          datashow(beforeData.tmpProject, project);
          odataclears[17].checked = false;
          isDel = true;
        }
        // 所有日历数据
        if (odataclears[18].checked) {
          localDel('calendar');
          localDel('calendarHobbit');
          calendarData = {};
          hobbitData = {};
          chooseCalendarShow(dcalendarType, 'delete');

          odataclears[18].checked = false;
          isDel = true;
        }
        if (isDel) {
          oResults[6].innerText = '(成功)';
        }
        if (isCheck && oshowings[2].style.display === 'block') {
          // 统筹数据的更新
          checkSummary();
        }
      }

      function chooseTheme(num) {
        var chose = -1;
        var old = document.body.className;
        if (othemechooses[0].checked) {
          chose = 0;
          document.body.className = 'theme-light';
        }
        if (othemechooses[1].checked) {
          chose = 1;
          document.body.className = 'theme-gray';
        }
        if (othemechooses[2].checked) {
          chose = 2;
          document.body.className = 'theme-deep';
        }
        if (num === -1) {
          userDefined['themeMode'] = chose;
          localSave('userDefined', userDefined, 'object');
        }
        if (old.indexOf('popuping') !== -1) {
          document.body.classList.add('popuping');
        }
      }
      document.onkeydown = function(event) {
        var e = event || window.event;
        var keycode = e.keyCode || e.which;
        var iscloseSetting = false;
        var iscloseWriting = false;
        var isclosepopup = false;
        var iscloseFloor = false;
        var isFirstPage = false;
        // log(e.key, keycode);
        if (e.altKey && keycode == 65) { // alt+a 主编辑页
          isFirstPage = true;
          isclosepopup = true;
          iscloseSetting = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }
        if (e.altKey && keycode == 66) { // alt+b 收集箱
          toMainSquare(0);
          iscloseSetting = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }
        if (e.altKey && keycode == 67) { // alt+c 检查页
          toNewpart(2);
          isclosepopup = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }

        if (e.altKey && keycode == 73) { // alt+i 项目管理
          toMainSquare(4, '模板');
          iscloseSetting = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }

        if (e.altKey && keycode == 81) { // alt+q 问题记录
          toMainSquare(3);
          iscloseSetting = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }
        if (e.altKey && keycode == 82) { // alt+r  日历/记录签
          toMainSquare(5);
        }

        if (e.altKey && keycode == 83) { // alt+s 搜索
          webSearchFun();
        }
        if (e.altKey && keycode == 84) { // alt+t  标签页搜索
          toMainSquare(1);
          var val = osimpleWriteBox.value || writebox.value;
          if (val) {
            tosearchtag(val);
          }
          iscloseSetting = true;
          iscloseWriting = true;
          iscloseFloor = true;
        }

        if (e.altKey && keycode == 87) { // alt+w  书写框
          writeLayer();
        }



        if (e.altKey && keycode == 90) { // 27是esc  90是z, 还是有必要把alt带上，否则直接英文输入就会直接触发
          iscloseSetting = true;
          iscloseWriting = true;
          isclosepopup = true;
          iscloseFloor = true;
        }
        readyInterface(iscloseSetting, iscloseWriting, isclosepopup, iscloseFloor, isFirstPage);

      }

      function readyInterface(iscloseSetting = false, iscloseWriting = false, isclosepopup = false, iscloseFloor =
        false, isFirstPage = false) {
        if (iscloseFloor && floor.style.display === 'block') {
          summPartToggle();
        }
        if (isclosepopup && omorefunpart.classList.contains('open')) {
          toMainSquare(numOfSection);
        }

        if (iscloseSetting && osetting.classList.contains('active')) {
          settingOpen(); // 主页面，收集箱，标签页，问题记录页面快捷键打开时关闭设置面板
        }
        if (iscloseWriting && owrite.style.display === 'block') {
          writeLayer();
        }
        if (isFirstPage) {
          nowIsMainPage();
        }
      }
      onowlocation.onclick = nowIsMainPage;

      function nowIsMainPage(type) {
        if (type !== 'load') {
          toNewpart(n_newpartshow);
        }
        omain.classList.remove('unshow');
        var oparts = toGet('.content', true);
        oparts[0].style.display = 'block';
        oparts[1].style.display = 'none';
        omain.classList.remove('simple');
        simplebtns[0].setAttribute('data-name', '切简版');
        simplebtns[0].classList.remove('liner');
        omenu.classList.add('on');
        onowlocation.style.display = 'none';
        ologo.style.display = 'block';
      }
      writebox.onkeydown = function(event) {
        var e = event || window.event;
        var keycode = e.keyCode || e.which;
        if (e.altKey && keycode == 13) { // alt+enter
          inputDataSet();
        }
        if (e.altKey && keycode == 68) { // alt+d
          quickTodo();
        }
      }
      var tOhelpTip = null;
      var osearchModeline = toGet('.searchModeline');
      osearchModeline.onclick = function(e) {
        clearTimeout(tOhelpTip);
        var event = e || window.event;
        var ele = event.target || event.srcElement;
        if (ele.tagName === 'INPUT' || ele.tagName === 'SPAN') {
          for (let i = 0; i < osearchModes.length; i++) {
            if (osearchModes[i].checked) {
              n_searchChoose = i;
              userDefined['searchWeb'] = i;
              localSave('userDefined', userDefined, 'object');
              oResults[1].innerText = '(OK)';
              txtData['searchCondition'] = growData['searchName'][i] + '·改' + (userDefined[
                'recordSearchChose'] ? ' (记录中)' : '');
              otoWebSearchBtn.innerText = txtData['searchCondition'];
              oworktoWebSearchBtn.setAttribute('data-tip', growData['searchName'][i]);
              menuBtns[16].innerText = txtData['searchCondition'];

              tOhelpTip = setTimeout(function() {
                oResults[1].innerText = '';
              }, 2000);
              break;
            }
          }
        }

      }

      // 开启 or 关闭 特殊项
      var oreferLinkbtn = document.querySelector('.referLink .restartbtn');
      oreferLinkbtn.onclick = function(e) {
        moreStart(e, 'tolinkrefer');
      }

      var oRestarts = document.querySelectorAll('.thirdCon .restartbtn');
      oRestarts[0].onclick = function(e) { // 操作小菜单保留
        moreStart(e, 'controlChose');
      }
      oRestarts[1].onclick = function(e) { // 每次生成数据后都清空表单 
        moreStart(e, 'deleteChose');
      }
      oRestarts[2].onclick = function(e) { // 倒计时结束后播放音效
        moreStart(e, 'audioChose');
      }
      oRestarts[3].onclick = function(e) { // 简化输出处理数据（只含完成清单+小本本+参考资料）
        moreStart(e, 'outputChose');
        if (simplebtns[0].getAttribute('data-name') === '切编辑' && n_newpartshow === -1) { // 在简版页
          toOutput('solve', 'copy');
        }
      }
      oRestarts[4].onclick = function(e) { // 完成清单搜索结果显示没有完成项的日期
        moreStart(e, 'unshowNoneChose');
      }
      oRestarts[5].onclick = function(e) { // utools自动保存的开启
        moreStart(e, 'saveLocalChose');
      }
      oRestarts[6].onclick = function(e) { // 记录搜索内容
        moreStart(e, 'recordSearchChose');
      }
      oRestarts[7].onclick = function(e) { // 日历签顺序排列数据
        moreStart(e, 'calendarSortChose');
      }

      function moreStart(event, name) { // 设置面板的开启关闭项
        var e = event || window.event;
        var element = e.target || e.srcElement;
        var txt = element.getAttribute('data-txt');
        if (txt === '开启') {
          element.setAttribute('data-txt', '关闭');
          element.classList.add('active');

          if (name === 'outputChose') {
            userDefined[name] = 'simple';
          } else {
            userDefined[name] = 1;
          }

          if (name === 'calendarSortChose') {
            osortCalendarBtn.innerText = '逆序';
            dsortType = '1';
          }
        } else {
          element.setAttribute('data-txt', '开启');
          element.classList.remove('active');
          if (name === 'outputChose') {
            userDefined[name] = 'all';
          } else {
            userDefined[name] = 0;
          }
          if (name === 'calendarSortChose') {
            osortCalendarBtn.innerText = '顺序';
            dsortType = '0';
          }
        }
        if (name === 'tolinkrefer') {
          tolinkReferFun(); // 显示
        }
        if (name === 'controlChose') {
          if (txt === '开启') {
            opages.classList.add('ok');
            ocontent.classList.add('ok');
          } else {
            opages.classList.remove('ok');
            ocontent.classList.remove('ok');
          }
        }

        if (n_newpartshow === 2 && name === 'unshowNoneChose') {
          showFinishtask();
        }
        if (name === 'recordSearchChose') {
          let tmpTxt = otoWebSearchBtn.innerText;
          let tmp1 = tmpTxt.slice(0, -6);
          let tmp2 = tmpTxt + ' (记录中)';
          if (tmpTxt.indexOf('记录中') !== -1) {
            txtData['searchCondition'] = tmp1;
            otoWebSearchBtn.innerText = tmp1;
            menuBtns[16].innerText = tmp1;
          } else {
            txtData['searchCondition'] = tmp2;
            otoWebSearchBtn.innerText = tmp2;
            menuBtns[16].innerText = tmp2;
          }
        }
        if (numOfSection === 5 && name === 'calendarSortChose') {
          nowCalendarShow();
        }

        clearTimeout(tOhelpTip);
        localSave('userDefined', userDefined, 'object');
      }
      var olinkReference = toGet('.linkReference');

      function tolinkReferFun() {
        // 前提有linkArr
        if (userDefined['tolinkrefer']) {
          oreferLinkbtn.setAttribute('data-txt', '关闭');
          oreferLinkbtn.classList.add('active');
          let list = linkArr;
          if (list.length !== 0) {
            let str = '';
            for (let a = 0; a < list.length; a++) {
              if (list[a].trim()) {
                str = str + '<li>' + list[a].trim() +
                  '<span class="deletebtn line" onclick="simpleDelete(event)">×</span></li>';
              }
            }
            olinkReference.innerHTML = str;
            olinkReference.style.display = 'block';
          } else {
            olinkReference.style.display = 'none';
          }

        } else {
          oreferLinkbtn.classList.remove('active');
          oreferLinkbtn.setAttribute('data-txt', '开启');
          olinkReference.innerHTML = '';
          olinkReference.style.display = 'none';
        }
      }
    </script>

    <script src="./js/calendar.js"></script>
    <!-- <script src="./js/test.js"></script> -->
  </body>

</html>
